C# Class AA2Install.formMain

Mostra file Open project: aa2g/AA2Install Class Usage Examples

Public Properties

Property Type Description
Plugins List
bench DateTime
cancelPending bool
change formChanges
cmbSorting System.Windows.Forms.ToolStripComboBox
currentOwner Form
imageTimer System.Windows.Forms.Timer
isChecking bool
labelStatus System.Windows.Forms.ToolStripStatusLabel
lsvLog System.Windows.Forms.ListView
lsvMods System.Windows.Forms.ListView
modDict ModDictionary

Public Methods

Method Description
CheckInstalled ( ) : bool
FlushCache ( ) : void

Deletes cache and rebuilds configuration file.

GetFilesRegex ( string directory, string regex ) : List
IsEnoughFreeSpace ( string drivePath, long requiredBytes ) : bool

Returns true or false if the drive indicated has enough space for the operation.

TryDeleteDirectory ( string target_dir ) : void

Deletes a directory where it can fail to do so (large directories like TEMP).

UpdateReg ( bool checkAfter = true ) : void
deleteSelectedMods ( bool suppressDialogs = false ) : void

Prompts and deletes selected mods in the list view.

forceSelectedMods ( bool suppressDialogs = false ) : void
formMain ( ) : System
formMain_Shown ( object sender, EventArgs events ) : void
getFiles ( string SourceFolder, string Filter, System searchOption ) : string[]

Returns a list of files in a directory.

getTimeSinceLastCheck ( ) : TimeSpan
initializeBench ( ) : void
inject ( bool createBackup = false, bool checkConflicts = true, bool suppressPopups = false ) : bool

Injects mods as per selected in lsvMods.

loadUIConfiguration ( ) : void

Updates UI to values in configuration.

refreshModList ( bool skipReload = false, string filter = "" ) : void

Refreshes the list from the /mods/ directory.

setEnabled ( bool enabled ) : void

Sets enabled status of essential controls.

tryCancel ( ) : bool

Cancels if cancelPending is set to true.

tryDelete ( string filename ) : TryDeleteResult

Tries to delete file, and prompts user if the file is being accessed.

updateLog ( string l ) : void

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

Private Methods

Method Description
BytesToString ( long bytes ) : string

Converts a length of bytes into a human readable form.

InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

aboutToolStripMenuItem_Click ( object sender, EventArgs e ) : void
btnAA2EDIT_Click ( object sender, EventArgs e ) : void
btnAA2PLAY_Click ( object sender, EventArgs e ) : void
btnApply_Click ( object sender, EventArgs e ) : void
btnBrowseMigrate_Click ( object sender, EventArgs e ) : void
btnCancel_Click ( object sender, EventArgs e ) : void
btnEDITreg_Click ( object sender, EventArgs e ) : void
btnLoadModpack_Click ( object sender, EventArgs e ) : void
btnMigrate_Click ( object sender, EventArgs e ) : void
btnPLAYreg_Click ( object sender, EventArgs e ) : void
btnRefresh_Click ( object sender, EventArgs e ) : void
btnRegUpdate_Click ( object sender, EventArgs e ) : void
checkAA2EDIT_CheckedChanged ( object sender, EventArgs e ) : void
checkAA2PLAY_CheckedChanged ( object sender, EventArgs e ) : void
checkConflicts_CheckedChanged ( object sender, EventArgs e ) : void
checkSuppress_CheckedChanged ( object sender, EventArgs e ) : void
chkCompatibility_CheckedChanged ( object sender, EventArgs e ) : void
clearLogToolStripMenuItem_Click ( object sender, EventArgs e ) : void
cmbSorting_SelectedIndexChanged ( object sender, EventArgs e ) : void
deleteToolStripMenuItem_Click ( object sender, EventArgs e ) : void
exitToolStripMenuItem_Click ( object sender, EventArgs e ) : void
flushCacheToolStripMenuItem_Click ( object sender, EventArgs e ) : void
forceInstallToolStripMenuItem_Click ( object sender, EventArgs e ) : void
imageTimer_Tick ( object sender, EventArgs e ) : void
lsvMods_DrawColumnHeader ( object sender, DrawListViewColumnHeaderEventArgs e ) : void
lsvMods_DrawItem ( object sender, DrawListViewItemEventArgs e ) : void
lsvMods_ItemChecked ( object sender, ItemCheckedEventArgs e ) : void
lsvMods_KeyPress ( object sender, KeyEventArgs e ) : void
lsvMods_SelectedIndexChanged ( object sender, EventArgs e ) : void
lsvMods_SizeChanged ( object sender, EventArgs e ) : void
pendingChangesToolStripMenuItem_Click ( object sender, EventArgs e ) : void
txtAA2EDIT_TextChanged ( object sender, EventArgs e ) : void
txtAA2PLAY_TextChanged ( object sender, EventArgs e ) : void
txtEDITreg_TextChanged ( object sender, EventArgs e ) : void
txtPLAYreg_TextChanged ( object sender, EventArgs e ) : void
txtSearch_TextChanged ( object sender, EventArgs e ) : void
updateStatus ( string entry, LogIcon icon = LogIcon.Ready, bool displayTime = true, bool onlyStatusBar = false ) : void
updateTaskbarProgress ( TaskbarProgress state = TaskbarProgress.TaskbarStates.Normal ) : void
updateTaskbarProgress ( int value, int maximum, TaskbarProgress state = TaskbarProgress.TaskbarStates.Normal ) : void

Method Details

CheckInstalled() public method

public CheckInstalled ( ) : bool
return bool

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void

FlushCache() public method

Deletes cache and rebuilds configuration file.
public FlushCache ( ) : void
return void

GetFilesRegex() public method

public GetFilesRegex ( string directory, string regex ) : List
directory string
regex string
return List

IsEnoughFreeSpace() public method

Returns true or false if the drive indicated has enough space for the operation.
public IsEnoughFreeSpace ( string drivePath, long requiredBytes ) : bool
drivePath string The path to the drive (eg. "C:\")
requiredBytes long The amount of bytes required for the operation.
return bool

TryDeleteDirectory() public static method

Deletes a directory where it can fail to do so (large directories like TEMP).
public static TryDeleteDirectory ( string target_dir ) : void
target_dir string Target directory.
return void

UpdateReg() public method

public UpdateReg ( bool checkAfter = true ) : void
checkAfter bool
return void

deleteSelectedMods() public method

Prompts and deletes selected mods in the list view.
public deleteSelectedMods ( bool suppressDialogs = false ) : void
suppressDialogs bool Whether or not to suppress dialogs and prompts.
return void

forceSelectedMods() public method

public forceSelectedMods ( bool suppressDialogs = false ) : void
suppressDialogs bool
return void

formMain() public method

public formMain ( ) : System
return System

formMain_Shown() public method

public formMain_Shown ( object sender, EventArgs events ) : void
sender object
events EventArgs
return void

getFiles() public method

Returns a list of files in a directory.
public getFiles ( string SourceFolder, string Filter, System searchOption ) : string[]
SourceFolder string Directory to search.
Filter string Filter; can have multiple filters split by '|'.
searchOption System Option to search by.
return string[]

getTimeSinceLastCheck() public method

public getTimeSinceLastCheck ( ) : TimeSpan
return TimeSpan

initializeBench() public method

public initializeBench ( ) : void
return void

inject() public method

Injects mods as per selected in lsvMods.
public inject ( bool createBackup = false, bool checkConflicts = true, bool suppressPopups = false ) : bool
createBackup bool Creates a backup of modified .pp files if true. Default is false.
checkConflicts bool Checks for conflicts in pending mods. Default is true.
suppressPopups bool If true, does not generate message boxes. Default is false.
return bool

loadUIConfiguration() public method

Updates UI to values in configuration.
public loadUIConfiguration ( ) : void
return void

refreshModList() public method

Refreshes the list from the /mods/ directory.
public refreshModList ( bool skipReload = false, string filter = "" ) : void
skipReload bool
filter string
return void

setEnabled() public method

Sets enabled status of essential controls.
public setEnabled ( bool enabled ) : void
enabled bool Sets enabled status to this.
return void

tryCancel() public method

Cancels if cancelPending is set to true.
public tryCancel ( ) : bool
return bool

tryDelete() public method

Tries to delete file, and prompts user if the file is being accessed.
public tryDelete ( string filename ) : TryDeleteResult
filename string
return TryDeleteResult

updateLog() public method

public updateLog ( string l ) : void
l string
return void

Property Details

Plugins public_oe property

public List Plugins
return List

bench public_oe property

public DateTime bench
return DateTime

cancelPending public_oe property

Flag for if cancellation is pending.
public bool cancelPending
return bool

change public_oe property

public formChanges,AA2Install change
return formChanges

cmbSorting public_oe property

public System.Windows.Forms.ToolStripComboBox cmbSorting
return System.Windows.Forms.ToolStripComboBox

currentOwner public_oe property

public Form currentOwner
return Form

imageTimer public_oe property

public System.Windows.Forms.Timer imageTimer
return System.Windows.Forms.Timer

isChecking public_oe property

public bool isChecking
return bool

labelStatus public_oe property

public System.Windows.Forms.ToolStripStatusLabel labelStatus
return System.Windows.Forms.ToolStripStatusLabel

lsvLog public_oe property

public System.Windows.Forms.ListView lsvLog
return System.Windows.Forms.ListView

lsvMods public_oe property

public System.Windows.Forms.ListView lsvMods
return System.Windows.Forms.ListView

modDict public_oe property

public ModDictionary modDict
return ModDictionary