C# Class KFreonLib.GUI.Gooey

Allows some control over changing the state (enabled/visible) of a set of controls. Features: Exclude controls from state changes. Switch state changes between enabling and changing visibility. A function can replace state changes. e.g. Instead of enabling, set some text or whatever.
ファイルを表示 Open project: ME3Explorer/ME3Explorer Class Usage Examples

Public Methods

Method Description
AddControl ( object control, string key, object stateChangeEffect, bool affectedByStateChange = true, bool trueIsEnabledProperty = true ) : bool

Adds given control to list of controls to be maintained by this class.

ChangeState ( bool state ) : void

Changes state of all listed controls.

GetControlAffectedState ( string key ) : bool

Gets whether control specified by key is affected by state changes.

Gooey ( Control baseControl ) : System
ModifyControl ( string key, bool AffectedByStateChange ) : void

Modifies control specified by key, changes whether control is affected by state changes.

Private Methods

Method Description
ControlChange ( string type, string key, bool state, Control item ) : void
ControlChange ( string type, string key, bool state, ToolStripItem item ) : void
PerformStateChange ( bool state ) : void

Method Details

AddControl() public method

Adds given control to list of controls to be maintained by this class.
public AddControl ( object control, string key, object stateChangeEffect, bool affectedByStateChange = true, bool trueIsEnabledProperty = true ) : bool
control object Control to be added (ToolStripItem or Form Control)
key string Key to identify control. MUST be a unique part of the Control name.
stateChangeEffect object Effect to be run on state change. Bool or Action.
affectedByStateChange bool Optional. If true, this control is affected by state changes.
trueIsEnabledProperty bool Optional. If true, property affected by state changes is the Enabled property, otherwise uses the visible property.
return bool

ChangeState() public method

Changes state of all listed controls.
public ChangeState ( bool state ) : void
state bool If true, enables/makes visible. Functions run regardless and take state as parameter.
return void

GetControlAffectedState() public method

Gets whether control specified by key is affected by state changes.
public GetControlAffectedState ( string key ) : bool
key string Key of control to look for.
return bool

Gooey() public method

public Gooey ( Control baseControl ) : System
baseControl System.Windows.Forms.Control
return System

ModifyControl() public method

Modifies control specified by key, changes whether control is affected by state changes.
public ModifyControl ( string key, bool AffectedByStateChange ) : void
key string Key of control to change.
AffectedByStateChange bool If true, control is affected by state changes.
return void