C# Class BF2Statistics.MedalData.MedalDataEditor

Inheritance: System.Windows.Forms.Form
Show file Open project: BF2Statistics/ControlCenter Class Usage Examples

Public Properties

Property Type Description
ChangesMade bool
PythonPath string
SelectedAward IAward

Protected Properties

Property Type Description
ActiveProfile string
Child ConditionForm
ConditionNode System.Windows.Forms.TreeNode
LastSelectedProfile string
SelectedAwardNode System.Windows.Forms.TreeNode

Public Methods

Method Description
DeleteCriteria ( ) : void

Removes a criteria from the selected awards condition tree

EditCriteria ( ) : void

Brings up the Criteria Editor for the selected Award Condition Node

MedalDataEditor ( ) : System

Constructor

SetAwardImage ( string name ) : void

Sets the award image based on the Award ID Passed

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

LoadProfiles ( ) : void

Scans the stats directory, and adds each found medal data profile to the profile selector

ValidateConditions ( TreeNode AwardNode, Condition Con ) : void

This method is used to highlight the invalid condition nodes of the current selected AwardNode, to let the user know that the conditions selected wont work properly when loaded by the server

Applies highlighting from the Award Node => to => The Root Node

Private Methods

Method Description
ActivateProfileBtn_Click ( object sender, EventArgs e ) : void

Activates the current profile within the BF2StatisticsConfig.py

AddNewCriteria ( object sender, FormClosingEventArgs e ) : void

Adds a new criteria to an award from the Add Critera Dialog

AwardConditionsTree_AfterSelect ( object sender, TreeViewEventArgs e ) : void

Assigns the correct Context menu options based on the selected node

AwardConditionsTree_BeforeCollapse ( object sender, System.Windows.Forms.TreeViewCancelEventArgs e ) : void

Disables collapsing of condition tree nodes

AwardConditionsTree_KeyDown ( object sender, KeyEventArgs e ) : void

Allows enter and delete keys to edit and delete criteria

AwardConditionsTree_NodeMouseDoubleClick ( object sender, TreeNodeMouseClickEventArgs e ) : void

Allows edit of criteria's on double mouse click

AwardTree_AfterSelect ( object sender, TreeViewEventArgs e ) : void

An event called everytime a new award is selected... It repaints the current award info

DelProfileBtn_Click ( object sender, EventArgs e ) : void

Deletes the selected profile

DeleteCriteriaMenuItem_Click ( object sender, EventArgs e ) : void

When the delete option is pressed, removes the criteria

EditCriteriaMenuItem_Click ( object sender, EventArgs e ) : void

Edit Criteria option Click

InitializeComponent ( ) : void

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

NewCriteriaMenuItem_Click ( object sender, EventArgs e ) : void

Adding a new Criteria

NewCriteria_Closing ( object sender, FormClosingEventArgs e ) : void

Shows the correct new criteria screen when the uesr selects which type.

NewProfileBtn_Click ( object sender, EventArgs e ) : void

Opens the dialog to create a new profile

ProfileSelector_SelectedIndexChanged ( object sender, EventArgs e ) : void

This method is called upon selecting a new Medal Data Profile. It loads the new medal data, and calls the parser to parse it.

RestoreToDefaultMenuItem_Click ( object sender, EventArgs e ) : void

Restores the condition / criteria back to default (vanilla)

SaveButton_Click ( object sender, EventArgs e ) : void

Saves the medal data to a file

UndoAllChangesMenuItem_Click ( object sender, EventArgs e ) : void

When the Undo Changes menu option is selected, this method reverts any changes made to the current condition list

ValidateConditions ( ) : void

This method is used to highlight the invalid condition nodes in the conditions treeview, as to let the user know that the conditions selected wont work properly when loaded by the server

Applies highlighting from the Root Nodes => to => The Award Nodes

Method Details

DeleteCriteria() public method

Removes a criteria from the selected awards condition tree
public DeleteCriteria ( ) : 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

EditCriteria() public method

Brings up the Criteria Editor for the selected Award Condition Node
public EditCriteria ( ) : void
return void

LoadProfiles() protected method

Scans the stats directory, and adds each found medal data profile to the profile selector
protected LoadProfiles ( ) : void
return void

MedalDataEditor() public method

Constructor
public MedalDataEditor ( ) : System
return System

SetAwardImage() public method

Sets the award image based on the Award ID Passed
public SetAwardImage ( string name ) : void
name string The Award ID
return void

ValidateConditions() protected method

This method is used to highlight the invalid condition nodes of the current selected AwardNode, to let the user know that the conditions selected wont work properly when loaded by the server
Applies highlighting from the Award Node => to => The Root Node
protected ValidateConditions ( TreeNode AwardNode, Condition Con ) : void
AwardNode System.Windows.Forms.TreeNode
Con Condition
return void

Property Details

ActiveProfile protected property

The current active profile in the BF2sConfig.py
protected string ActiveProfile
return string

ChangesMade public static property

Indicates whether changes have been made to any criteria
public static bool ChangesMade
return bool

Child protected property

Our child form if applicable
protected ConditionForm,BF2Statistics.MedalData Child
return ConditionForm

ConditionNode protected property

The highlighted Award condition node (if any)
protected TreeNode,System.Windows.Forms ConditionNode
return System.Windows.Forms.TreeNode

LastSelectedProfile protected property

Indicates the last selected profile
protected string LastSelectedProfile
return string

PythonPath public static property

The full path to the "stats" python folder
public static string PythonPath
return string

SelectedAward public static property

The current selected award
public static IAward SelectedAward
return IAward

SelectedAwardNode protected property

The current selected award node
protected TreeNode,System.Windows.Forms SelectedAwardNode
return System.Windows.Forms.TreeNode