Table of Contents

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

ResourceId string

Resource id of the label text

lineWidthList LineWidthList

The list providing the choices

iLineWidth ILineWidth

The object whose line width is edited

includeUndefined bool

true: 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

ResourceId string

Resource id of the label text

lineWidthList LineWidthList

The list providing the choices

select LineWidth

The 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

ResourceId string

Resource id of the label text

lineWidthList LineWidthList

The list providing the choices

select LineWidth

The initially selected line width, or null for "undefined" resp. no selection

includeUndefined bool

true: 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

IGeoObject

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

propertyPage IPropertyPage

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

selected string

The selected text

Removed(IPropertyPage)

public override void Removed(IPropertyPage propertyPage)

Parameters

propertyPage IPropertyPage

the 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

Event Type

LineWidthSelectionProperty.LineWidthChangedDelegate