HermeticGUIControlSwitch Constructor |
Creates a control, bound to a member.
Namespace:
KSPDev.GUIUtils
Assembly:
KSPDev_Utils.2.0 (in KSPDev_Utils.2.0.dll) Version: 2.0 for KSP v1.8+
Syntaxpublic HermeticGUIControlSwitch(
Object instance,
FieldInfo fieldInfo = null,
PropertyInfo propertyInfo = null,
Action onBeforeUpdate = null,
Action onAfterUpdate = null,
bool useOwnLayout = true,
Func<Object, string> toStringConverter = null
)
Request Example
View SourceParameters
- instance
- Type: SystemObject
The class instance that owns the member to manage. - fieldInfo (Optional)
- Type: System.ReflectionFieldInfo
The field to manage. - propertyInfo (Optional)
- Type: System.ReflectionPropertyInfo
The property to manage. - onBeforeUpdate (Optional)
- Type: SystemAction
The callback to call before changing the value. InvalidOperationException can be
throws form this action to prevent the change.
- onAfterUpdate (Optional)
- Type: SystemAction
The callback to call when the value is changed. - useOwnLayout (Optional)
- Type: SystemBoolean
If false, then the control will start own horizontal section to align the input field
and buttons.
- toStringConverter (Optional)
- Type: SystemFuncObject, String
The function to use to map the enum values into a human friendly strings. By default, the enum
value is simply converted into string via ToString().
See Also