Class CheckProperty
- Namespace
- CADability.UserInterface
- Assembly
- CADability.dll
Property page entry with a check box. It either holds its own check state or reflects a boolean or CheckState property of another object, which is read and written via reflection (see the constructors). Clicking the box toggles the state (an indeterminate state is left unchanged) and raises CheckStateChangedEvent. Used e.g. for the visible layers of a view and for the entries of the attribute filters.
public class CheckProperty : IShowPropertyImpl, IShowProperty, IPropertyEntry
- Inheritance
-
CheckProperty
- Implements
- Inherited Members
Constructors
CheckProperty(object, string, string)
Creates an entry which reflects a property of ObjectWithProperty via reflection. The object must
either have a property named PropertyName of type bool or
CheckState, or a pair of methods "Get" + PropertyName(string) and
"Set" + PropertyName(string, bool), which receive the label text of the entry to identify it.
public CheckProperty(object ObjectWithProperty, string PropertyName, string resourceId)
Parameters
ObjectWithPropertyobjectThe object holding the property
PropertyNamestringName of the property, or the suffix of the Get/Set methods
resourceIdstringResource id of the label text
CheckProperty(string, CheckState)
Creates an entry which holds its own check state. Changes are reported by CheckStateChangedEvent.
public CheckProperty(string resourceID, CheckState state)
Parameters
resourceIDstringResource id of the label text
stateCheckStateThe initial check state
Properties
Flags
public override PropertyEntryType Flags { get; }
Property Value
Value
Implementation of Value: the text shown in the value column. The default is null, which means the entry has no value column; entries that show a value override it.
public override string Value { get; }
Property Value
Methods
ButtonClicked(PropertyEntryButton)
Implementation of ButtonClicked(PropertyEntryButton). The base implementation throws a NotImplementedException; an entry whose Flags announce a button (OK, cancel, check box, lock symbol, direct menu, value as button) must override it.
public override void ButtonClicked(PropertyEntryButton button)
Parameters
buttonPropertyEntryButtonthe button that was clicked
Update()
Refreshes the display of the entry, e.g. after the check state of the connected object was changed from elsewhere.
public void Update()
Events
CheckStateChangedEvent
Raised when the user has clicked the check box and the state was toggled.
public event CheckProperty.CheckStateChangedDelegate CheckStateChangedEvent