C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
ControlChange ( string type, string key, bool state, Control item ) : void
ControlChange ( string type, string key, bool state, ToolStripItem item ) : void
PerformStateChange ( bool state ) : void

Описание методов

AddControl() публичный Метод

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.
Результат bool

ChangeState() публичный Метод

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.
Результат void

GetControlAffectedState() публичный Метод

Gets whether control specified by key is affected by state changes.
public GetControlAffectedState ( string key ) : bool
key string Key of control to look for.
Результат bool

Gooey() публичный Метод

public Gooey ( Control baseControl ) : System
baseControl System.Windows.Forms.Control
Результат System

ModifyControl() публичный Метод

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.
Результат void