Table of Contents

Class HatchStyleSelectionProperty

Namespace
CADability.UserInterface
Assembly
CADability.dll

Property entry that lets the user choose a HatchStyle from a HatchStyleList in a drop-down list, optionally including an "undefined" entry. It either sets the hatch style of the IHatchStyle object (typically a Hatch) it was constructed for, following changes of that object (e.g. by undo), or it only reports the selection via the HatchStyleChangedEvent.

public class HatchStyleSelectionProperty : MultipleChoiceProperty, IPropertyEntry, IShowProperty
Inheritance
HatchStyleSelectionProperty
Implements
Inherited Members

Constructors

HatchStyleSelectionProperty(string, HatchStyleList, HatchStyle, bool)

Creates an entry which is not connected to an object; the selection is reported via HatchStyleChangedEvent.

public HatchStyleSelectionProperty(string ResourceId, HatchStyleList hsl, HatchStyle preselect, bool includeUndefined)

Parameters

ResourceId string

Resource id of the label text

hsl HatchStyleList

The list providing the choices

preselect HatchStyle

The initially selected hatch style, or null for "undefined" resp. no selection

includeUndefined bool

true: an "undefined" entry (resource "HatchStyle.Undefined") is offered as the first choice

HatchStyleSelectionProperty(string, HatchStyleList, IHatchStyle, bool)

Creates an entry which controls the hatch style of iHatchStyle. The current hatch style of the object is preselected; if the object is an IGeoObject, the entry follows changes of the object (e.g. by undo).

public HatchStyleSelectionProperty(string ResourceId, HatchStyleList hsl, IHatchStyle iHatchStyle, bool includeUndefined)

Parameters

ResourceId string

Resource id of the label text

hsl HatchStyleList

The list providing the choices

iHatchStyle IHatchStyle

The object whose hatch style is edited

includeUndefined bool

true: an "undefined" entry (resource "HatchStyle.Undefined") is offered as the first choice

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 propertyTreeView)

Parameters

propertyTreeView 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)

Implementation of Removed(IPropertyPage): closes the undo context of the project (an edit may have been interrupted by removing the entry), reports Removed and forgets the page. Override it to unsubscribe from events, and call the base implementation.

public override void Removed(IPropertyPage propertyTreeView)

Parameters

propertyTreeView IPropertyPage

SetSelection(HatchStyle)

Sets the current selection to the given hatch style without raising the event and without changing the connected object.

public void SetSelection(HatchStyle hatchStyle)

Parameters

hatchStyle HatchStyle

The hatch style to select, or null to clear the selection

Events

HatchStyleChangedEvent

Raised when the user selects a hatch style, before it is applied to the connected IHatchStyle object (if any).

public event HatchStyleSelectionProperty.HatchStyleChanged HatchStyleChangedEvent

Event Type

HatchStyleSelectionProperty.HatchStyleChanged