C# Class Depressurizer.FormMain

Inheritance: System.Windows.Forms.Form
显示文件 Open project: Theo47/depressurizer

Private Properties

Property Type Description
AddCategoryToSelectedGames void
AddGame void
AddGameToMultiCatCheckStates void
AddRemoveCategoryContextMenu void
ApplyFilter void
AssignFavoriteToSelectedGames void
AssignHiddenToSelectedGames void
AutoCatGameCount int
Autocategorize void
AutonameAll void
CheckForDepressurizerUpdates void
CheckForUnsaved bool
ColumnReorderWorker void
CreateCategory Category
CreateCategoryListViewItem System.Windows.Forms.ListViewItem
CreateProfile void
DeleteCategory void
DeleteFilter void
EditAutoCats void
EditGame void
EditProfile void
ExportConfig void
FillAllCategoryLists void
FillAutoCatLists void
FillCategoryList void
FillGameList void
FilterGamelist void
FixWebBrowserRegistry void
FormMain_FormClosing void
FormMain_Load void
FullListRefresh void
GetCategoryItemAtPoint System.Windows.Forms.ListViewItem
HandleAdvancedCategoryItemActivation void
HandleMouseWheel void
HandleMultiCatItemActivation void
ImportConfig void
InitializeComponent void
InitializeLstGames void
InitializeObjectListView void
LaunchGame void
LoadGameDB void
LoadProfile void
LoadProfile void
MakeChange void
ManualExportConfig void
OnProfileChange void
OnViewChange void
RebuildGamelist void
RefreshFilters void
RemoveCategoryFromSelectedGames void
RemoveEmptyCats void
RemoveGames void
RenameCategory bool
RenameFilter void
ResortToolStripItemCollection void
RunAutoCats void
SaveFilter void
SaveGameDB void
SaveProfile bool
SaveProfileAs void
SaveSelectedAutoCats void
SelectAutoCats void
SelectCategory void
SelectFilter void
SetAdvancedMode void
SetDragDropEffect void
SetItemState void
ShouldDisplayGame bool
ShouldHideGame bool
StartBannerThread void
Unload void
UpdateAutoCatSelected_StatusMessage void
UpdateEnabledStatesForCategories void
UpdateEnabledStatesForGames void
UpdateGameCheckStates void
UpdateGameDBFromAppInfo void
UpdateGameDBFromHltb void
UpdateGameList void
UpdateLibrary void
UpdateSelectedStatusText void
UpdateTitle void
UpdateUIForSingleCat void
ValidateCategoryName bool
ValidateFilterName bool
autoModeHelperToolStripMenuItem_Click void
cboFilter_SelectedIndexChanged void
changeLanguageControls void
changeLanguageToolStripItems void
cmdAddCatAndAssign_Click void
cmdGameAdd_Click void
cmdGameEdit_Click void
cmdGameLaunch_Click void
cmdGameRemove_Click void
contectCat_RemoveEmpty_Click void
contextAutoCat_Edit_Click void
contextCat_Opening void
contextCat_SetAdvanced_Allow_Click void
contextCat_SetAdvanced_Exclude_Click void
contextCat_SetAdvanced_None_Click void
contextCat_SetAdvanced_Require_Click void
contextGameAddCat_Category_Click void
contextGameAddCat_Create_Click void
contextGameHidden_No_Click void
contextGameHidden_Yes_Click void
contextGameRemCat_Category_Click void
contextGame_Opening void
contextGame_SetFav_No_Click void
contextGame_SetFav_Yes_Click void
contextGame_VisitStore_Click void
countascendingToolStripMenuItem_Click void
countdescendingToolStripMenuItem_Click void
lstCategories_DragDrop void
lstCategories_DragEnter void
lstCategories_DragLeave void
lstCategories_DragOver void
lstCategories_KeyDown void
lstCategories_Layout void
lstCategories_MouseDown void
lstCategories_SelectedIndexChanged void
lstGames_ColumnReordered void
lstGames_DoubleClick void
lstGames_FormatCell void
lstGames_FormatRow void
lstGames_ItemDrag void
lstGames_ItemsChanged void
lstGames_KeyDown void
lstGames_SelectedIndexChanged void
lstGames_SelectionChanged void
lstMultiCat_KeyPress void
lstMultiCat_MouseDown void
lvAutoCatType_DoubleClick void
lvAutoCatType_ItemCheck void
lvAutoCatType_ItemChecked void
lvAutoCatType_Layout void
lvAutoCatType_MouseDown void
mbtnAutoCategorize_Click void
mbtnCatAdd_Click void
mbtnCatDelete_Click void
mbtnCatRename_Click void
mbtnCategories_Click void
mbtnClearFilters_Click void
mbtnFilterDelete_Click void
mbtnFilterRename_Click void
mbtnSaveFilter_Click void
mbtnSearchClear_Click void
mchkAdvancedCategories_CheckedChanged void
mchkAutoCatSelected_CheckedChanged void
mchkBrowser_CheckedChanged void
menuToolsAutocat_Item_Click void
menu_About_Click void
menu_File_Close_Click void
menu_File_Exit_Click void
menu_File_LoadProfile_Click void
menu_File_Manual_Export_Click void
menu_File_NewProfile_Click void
menu_File_SaveProfileAs_Click void
menu_File_SaveProfile_Click void
menu_Profile_EditAutoCats_Click void
menu_Profile_Edit_Click void
menu_Profile_Export_Click void
menu_Profile_Import_Click void
menu_Profile_Restore_Config_Click void
menu_Profile_Restore_Profile_Click void
menu_Profile_Update_Click void
menu_Tools_AutonameAll_Click void
menu_Tools_DBEdit_Click void
menu_Tools_RemoveEmpty_Click void
menu_Tools_Settings_Click void
menu_Tools_SingleCat_Click void
mtxtSearch_TextChanged void
nameascendingToolStripMenuItem_Click void
namedescendingToolStripMenuItem_Click void
reorderFillerColumn void
txtAddCatAndAssign_TextChanged void

Public Methods

Method Description
AddStatus ( string s ) : void

Adds a string to the status builder

ClearStatus ( ) : void

Empties the status builder

FlushStatus ( ) : void

Sets the status text to the builder text, and clear the builder text.

FormMain ( ) : System

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

Private Methods

Method Description
AddCategoryToSelectedGames ( Category cat, bool forceClearOthers ) : void

Adds the given category to all selected games.

AddGame ( ) : void

Adds a new game. Displays the game dialog to the user.

AddGameToMultiCatCheckStates ( GameInfo game, bool first ) : void
AddRemoveCategoryContextMenu ( GameInfo game ) : void
ApplyFilter ( Depressurizer.Filter f ) : void
AssignFavoriteToSelectedGames ( bool fav ) : void

Assigns the given favorite state to all selected items in the game list.

AssignHiddenToSelectedGames ( bool hidden ) : void

Add or remove the hidden attribute to the selected games

AutoCatGameCount ( ) : int
Autocategorize ( bool selectedOnly, AutoCat autoCat, bool scrape = true, bool refresh = true ) : void

Autocategorizes a set of games.

AutonameAll ( ) : void

Renames all games with names from the database.

CheckForDepressurizerUpdates ( ) : void

Checks github for newer versions of depressurizer.

CheckForUnsaved ( ) : bool

If there are any unsaved changes, asks the user if they want to save. Also gives the user the option to cancel the calling action.

ColumnReorderWorker ( ) : void
CreateCategory ( ) : Category

Creates a new category, first prompting the user for the name to use. If the name is not valid or in use, displays a notification.

CreateCategoryListViewItem ( Category c ) : System.Windows.Forms.ListViewItem
CreateProfile ( ) : void

Prompts user to create a new profile.

DeleteCategory ( ) : void

Deletes the selected categories and updates the UI. Prompts user for confirmation.

DeleteFilter ( Depressurizer.Filter f ) : void
EditAutoCats ( AutoCat selected ) : void

Creates an Edit AutoCats dialog for the user

EditGame ( ) : void

Edits the first selected game. Displays game dialog.

EditProfile ( ) : void

Prompts the user to modify the currently loaded profile. If there isn't one, asks if the user would like to create one.

ExportConfig ( ) : void

Attempts to export steam categories

FillAllCategoryLists ( ) : void

Completely repopulates the category list and combobox. Maintains selection on both.

FillAutoCatLists ( ) : void
FillCategoryList ( bool sort ) : void

Completely repopulates the category list. Maintains selection.

FillGameList ( ) : void

Completely re-populates the game list.

FilterGamelist ( bool preserveSelection ) : void

Filters game list based on based on the current category selection and advanced filters

FixWebBrowserRegistry ( ) : void
FormMain_FormClosing ( object sender, FormClosingEventArgs e ) : void
FormMain_Load ( object sender, EventArgs e ) : void
FullListRefresh ( ) : void

Completely regenerates both the category and game lists

GetCategoryItemAtPoint ( int x, int y ) : System.Windows.Forms.ListViewItem
HandleAdvancedCategoryItemActivation ( System.Windows.Forms.ListViewItem i, bool reverse, bool updateView = true ) : void
HandleMouseWheel ( object sender, MouseEventArgs e ) : void
HandleMultiCatItemActivation ( System.Windows.Forms.ListViewItem item, bool modKey ) : void
ImportConfig ( ) : void

Attempts to import steam categories

InitializeComponent ( ) : void

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

InitializeLstGames ( ) : void

Initializes the lstGames Control.

InitializeObjectListView ( ) : void
LaunchGame ( GameInfo g ) : void

Launchs selected game Game to launch

LoadGameDB ( ) : void

Loads the database from disk. If the load fails, displays a message box and creates an empty DB.

LoadProfile ( ) : void

Prompts user for a profile file to load, then loads it.

LoadProfile ( string path, bool checkForChanges = true ) : void

Loads the given profile file.

MakeChange ( bool changes ) : void

Sets the unsaved changes flag to the given value and takes the requisite UI updating action

ManualExportConfig ( ) : void

Saves a Steam configuration file. Asks the user to select the file to save as.

OnProfileChange ( ) : void

Updates UI after a profile is created, loaded, modified or closed.

OnViewChange ( ) : void

Does all list updating that's required if the filter changes (category selection changes).

RebuildGamelist ( ) : void

Rebuild all the list view items in the gamelist, preserving as much state as is possible

RefreshFilters ( ) : void
RemoveCategoryFromSelectedGames ( Category cat ) : void

Removes the given category from all selected games.

RemoveEmptyCats ( ) : void

Removes any categories with no games assigned.

RemoveGames ( ) : void

Removes all selected games. Prompts for confirmation.

RenameCategory ( ) : bool

Renames the given category. Prompts user for a new name. Updates UI. Will display an error if the rename fails.

RenameFilter ( Depressurizer.Filter f ) : void
ResortToolStripItemCollection ( ToolStripItemCollection coll ) : void
RunAutoCats ( List autocats, bool first, bool group = false ) : void
SaveFilter ( ) : void
SaveGameDB ( ) : void

Saves the current database to disk. Displays a message box on failure.

SaveProfile ( string path = null ) : bool

Saves profile data to a file and performs any related tasks. This is the main saving function, all saves go through this function.

SaveProfileAs ( ) : void

Prompts user for a file location and saves profile

SaveSelectedAutoCats ( ) : void
SelectAutoCats ( Settings settings ) : void
SelectCategory ( Settings settings ) : void
SelectFilter ( Settings settings ) : void
SetAdvancedMode ( bool enabled ) : void
SetDragDropEffect ( DragEventArgs e ) : void
SetItemState ( System.Windows.Forms.ListViewItem i, int state ) : void
ShouldDisplayGame ( GameInfo g ) : bool

Checks to see if a game should currently be displayed, based on the state of the category list.

ShouldHideGame ( GameInfo g ) : bool
StartBannerThread ( List games ) : void
Unload ( ) : void

Unloads the current profile or game list, making sure the user gets the option to save any changes.

UpdateAutoCatSelected_StatusMessage ( ) : void
UpdateEnabledStatesForCategories ( ) : void
UpdateEnabledStatesForGames ( ) : void

Updates enabled states for all game and category buttons

UpdateGameCheckStates ( ) : void
UpdateGameDBFromAppInfo ( ) : void

Updates the database using AppInfo cache. Displays an error message on failure. Saves the DB afterwards if AutosaveDB is set.

UpdateGameDBFromHltb ( ) : void

Updates the database using data from howlongtobeatsteam.com. Displays an error message on failure. Saves the DB afterwards if AutosaveDB is set.

UpdateGameList ( ) : void

Updates list item for every game on the list, removing games that no longer need to be there, but not adding new ones.

UpdateLibrary ( ) : void

Updates the game list for the loaded profile.

UpdateSelectedStatusText ( ) : void

Updates the text displaying the number of items in the game list

UpdateTitle ( ) : void

Updates the window title.

UpdateUIForSingleCat ( ) : void

Update UI to match current state of the SingleCatMode setting

ValidateCategoryName ( string name ) : bool

Checks to see if a category name is valid. Does not make sure it isn't already in use. If the name is not valid, displays a warning.

ValidateFilterName ( string name ) : bool
autoModeHelperToolStripMenuItem_Click ( object sender, EventArgs e ) : void
cboFilter_SelectedIndexChanged ( object sender, EventArgs e ) : void
changeLanguageControls ( Control c, ComponentResourceManager resources, CultureInfo newCulture ) : void

jpodadera. Recursive function to reload resources of new language for a control and its childs

changeLanguageToolStripItems ( ToolStripItem item, ComponentResourceManager resources, CultureInfo newCulture ) : void

jpodadera. Recursive function to reload resources of new language for a menu item and its childs

cmdAddCatAndAssign_Click ( object sender, EventArgs e ) : void
cmdGameAdd_Click ( object sender, EventArgs e ) : void
cmdGameEdit_Click ( object sender, EventArgs e ) : void
cmdGameLaunch_Click ( object sender, EventArgs e ) : void
cmdGameRemove_Click ( object sender, EventArgs e ) : void
contectCat_RemoveEmpty_Click ( object sender, EventArgs e ) : void
contextAutoCat_Edit_Click ( object sender, EventArgs e ) : void
contextCat_Opening ( object sender, System e ) : void
contextCat_SetAdvanced_Allow_Click ( object sender, EventArgs e ) : void
contextCat_SetAdvanced_Exclude_Click ( object sender, EventArgs e ) : void
contextCat_SetAdvanced_None_Click ( object sender, EventArgs e ) : void
contextCat_SetAdvanced_Require_Click ( object sender, EventArgs e ) : void
contextGameAddCat_Category_Click ( object sender, EventArgs e ) : void
contextGameAddCat_Create_Click ( object sender, EventArgs e ) : void
contextGameHidden_No_Click ( object sender, EventArgs e ) : void
contextGameHidden_Yes_Click ( object sender, EventArgs e ) : void
contextGameRemCat_Category_Click ( object sender, EventArgs e ) : void
contextGame_Opening ( object sender, System e ) : void
contextGame_SetFav_No_Click ( object sender, EventArgs e ) : void
contextGame_SetFav_Yes_Click ( object sender, EventArgs e ) : void
contextGame_VisitStore_Click ( object sender, EventArgs e ) : void
countascendingToolStripMenuItem_Click ( object sender, EventArgs e ) : void
countdescendingToolStripMenuItem_Click ( object sender, EventArgs e ) : void
lstCategories_DragDrop ( object sender, DragEventArgs e ) : void
lstCategories_DragEnter ( object sender, DragEventArgs e ) : void
lstCategories_DragLeave ( object sender, EventArgs e ) : void
lstCategories_DragOver ( object sender, DragEventArgs e ) : void
lstCategories_KeyDown ( object sender, KeyEventArgs e ) : void
lstCategories_Layout ( object sender, LayoutEventArgs e ) : void
lstCategories_MouseDown ( object sender, MouseEventArgs e ) : void
lstCategories_SelectedIndexChanged ( object sender, EventArgs e ) : void
lstGames_ColumnReordered ( object sender, ColumnReorderedEventArgs e ) : void
lstGames_DoubleClick ( object sender, EventArgs e ) : void
lstGames_FormatCell ( object sender, BrightIdeasSoftware e ) : void
lstGames_FormatRow ( object sender, FormatRowEventArgs e ) : void
lstGames_ItemDrag ( object sender, ItemDragEventArgs e ) : void
lstGames_ItemsChanged ( object sender, ItemsChangedEventArgs e ) : void
lstGames_KeyDown ( object sender, KeyEventArgs e ) : void
lstGames_SelectedIndexChanged ( object sender, EventArgs e ) : void
lstGames_SelectionChanged ( object sender, EventArgs e ) : void
lstMultiCat_KeyPress ( object sender, KeyPressEventArgs e ) : void
lstMultiCat_MouseDown ( object sender, MouseEventArgs e ) : void
lvAutoCatType_DoubleClick ( object sender, EventArgs e ) : void
lvAutoCatType_ItemCheck ( object sender, ItemCheckEventArgs e ) : void
lvAutoCatType_ItemChecked ( object sender, ItemCheckedEventArgs e ) : void
lvAutoCatType_Layout ( object sender, LayoutEventArgs e ) : void
lvAutoCatType_MouseDown ( object sender, MouseEventArgs e ) : void
mbtnAutoCategorize_Click ( object sender, EventArgs e ) : void
mbtnCatAdd_Click ( object sender, EventArgs e ) : void
mbtnCatDelete_Click ( object sender, EventArgs e ) : void
mbtnCatRename_Click ( object sender, EventArgs e ) : void
mbtnCategories_Click ( object sender, EventArgs e ) : void
mbtnClearFilters_Click ( object sender, EventArgs e ) : void
mbtnFilterDelete_Click ( object sender, EventArgs e ) : void
mbtnFilterRename_Click ( object sender, EventArgs e ) : void
mbtnSaveFilter_Click ( object sender, EventArgs e ) : void
mbtnSearchClear_Click ( object sender, EventArgs e ) : void
mchkAdvancedCategories_CheckedChanged ( object sender, EventArgs e ) : void
mchkAutoCatSelected_CheckedChanged ( object sender, EventArgs e ) : void
mchkBrowser_CheckedChanged ( object sender, EventArgs e ) : void
menuToolsAutocat_Item_Click ( object sender, EventArgs e ) : void
menu_About_Click ( object sender, EventArgs e ) : void
menu_File_Close_Click ( object sender, EventArgs e ) : void
menu_File_Exit_Click ( object sender, EventArgs e ) : void
menu_File_LoadProfile_Click ( object sender, EventArgs e ) : void
menu_File_Manual_Export_Click ( object sender, EventArgs e ) : void
menu_File_NewProfile_Click ( object sender, EventArgs e ) : void
menu_File_SaveProfileAs_Click ( object sender, EventArgs e ) : void
menu_File_SaveProfile_Click ( object sender, EventArgs e ) : void
menu_Profile_EditAutoCats_Click ( object sender, EventArgs e ) : void
menu_Profile_Edit_Click ( object sender, EventArgs e ) : void
menu_Profile_Export_Click ( object sender, EventArgs e ) : void
menu_Profile_Import_Click ( object sender, EventArgs e ) : void
menu_Profile_Restore_Config_Click ( object sender, EventArgs e ) : void
menu_Profile_Restore_Profile_Click ( object sender, EventArgs e ) : void
menu_Profile_Update_Click ( object sender, EventArgs e ) : void
menu_Tools_AutonameAll_Click ( object sender, EventArgs e ) : void
menu_Tools_DBEdit_Click ( object sender, EventArgs e ) : void
menu_Tools_RemoveEmpty_Click ( object sender, EventArgs e ) : void
menu_Tools_Settings_Click ( object sender, EventArgs e ) : void
menu_Tools_SingleCat_Click ( object sender, EventArgs e ) : void
mtxtSearch_TextChanged ( object sender, EventArgs e ) : void
nameascendingToolStripMenuItem_Click ( object sender, EventArgs e ) : void
namedescendingToolStripMenuItem_Click ( object sender, EventArgs e ) : void
reorderFillerColumn ( ) : void
txtAddCatAndAssign_TextChanged ( object sender, EventArgs e ) : void

Method Details

AddStatus() public method

Adds a string to the status builder
public AddStatus ( string s ) : void
s string
return void

ClearStatus() public method

Empties the status builder
public ClearStatus ( ) : void
return void

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

FlushStatus() public method

Sets the status text to the builder text, and clear the builder text.
public FlushStatus ( ) : void
return void

FormMain() public method

public FormMain ( ) : System
return System