Class LineWidthSelectionProperty
- Namespace
- CADability.UserInterface
- Assembly
- CADability.dll
Property entry which lets the user choose a LineWidth from a LineWidthList in a drop-down list, optionally including an "undefined" entry. When constructed for an object implementing ILineWidth, the selection is applied to that object and the entry follows changes of the object's line width; otherwise the selection is only reported via LineWidthChangedEvent.
public class LineWidthSelectionProperty : MultipleChoiceProperty, IPropertyEntry, IShowProperty
- Inheritance
-
LineWidthSelectionProperty
- Implements
- Inherited Members
Constructors
LineWidthSelectionProperty(string, LineWidthList, ILineWidth, bool)
Creates an entry which controls the line width of iLineWidth. The current line width of the
object is preselected; if the object is an IGeoObject, the entry follows changes of its line width
or style.
public LineWidthSelectionProperty(string ResourceId, LineWidthList lineWidthList, ILineWidth iLineWidth, bool includeUndefined)
Parameters
ResourceIdstringResource id of the label text
lineWidthListLineWidthListThe list providing the choices
iLineWidthILineWidthThe object whose line width is edited
includeUndefinedbooltrue: an "undefined" entry (resource "LineWidth.Undefined") is offered as the first choice
LineWidthSelectionProperty(string, LineWidthList, LineWidth)
Creates an entry without the "undefined" choice which is not connected to an object; the selection is reported via LineWidthChangedEvent.
public LineWidthSelectionProperty(string ResourceId, LineWidthList lineWidthList, LineWidth select)
Parameters
ResourceIdstringResource id of the label text
lineWidthListLineWidthListThe list providing the choices
selectLineWidthThe initially selected line width, or null for no selection
LineWidthSelectionProperty(string, LineWidthList, LineWidth, bool)
Creates an entry which is not connected to an object; the selection is reported via LineWidthChangedEvent.
public LineWidthSelectionProperty(string ResourceId, LineWidthList lineWidthList, LineWidth select, bool includeUndefined)
Parameters
ResourceIdstringResource id of the label text
lineWidthListLineWidthListThe list providing the choices
selectLineWidthThe initially selected line width, or null for "undefined" resp. no selection
includeUndefinedbooltrue: an "undefined" entry (resource "LineWidth.Undefined") is offered as the first choice
Properties
Connected
The IGeoObject whose line width is controlled by this entry. Setting it connects the entry to the new object (which must implement ILineWidth): its line width is changed when the user selects an entry, and the entry is refreshed when the line width or style of the object changes.
public IGeoObject Connected { get; set; }
Property Value
Methods
Added(IPropertyPage)
Implementation of Added(IPropertyPage): memorizes the page in propertyPage and reports Added. Override it to subscribe to events while the entry is displayed, and call the base implementation.
public override void Added(IPropertyPage propertyPage)
Parameters
propertyPageIPropertyPage
OnSelectionChanged(string)
Called when the user has picked a choice. Raises SelectionChangedEvent, stores the text in SelectedText and raises ValueChangedEvent. Derived classes override it to pass the selection on to the object they represent.
protected override void OnSelectionChanged(string selected)
Parameters
selectedstringThe selected text
Removed(IPropertyPage)
Overrides Removed(IPropertyPage)
public override void Removed(IPropertyPage propertyPage)
Parameters
propertyPageIPropertyPagethe IPropertyTreeView from which it was removed
Events
LineWidthChangedEvent
Raised when the user selects a line width, before it is applied to the connected object (if any).
public event LineWidthSelectionProperty.LineWidthChangedDelegate LineWidthChangedEvent