Table of Contents

Class HatchStyle

Namespace
CADability.Attribute
Assembly
CADability.dll

Abstract base class for all hatchstyles. A hatchstyle is used to define the interior of a Hatch object.

public abstract class HatchStyle : PropertyEntryImpl, IPropertyEntry, IShowProperty, ISerializable, INamedAttribute, ICommandHandler
Inheritance
HatchStyle
Implements
Derived
Inherited Members

Constructors

HatchStyle()

Creates a hatch style without a name that is not contained in a list. Only called by the constructors of the derived classes.

public HatchStyle()

HatchStyle(SerializationInfo, StreamingContext)

Constructor required by deserialization

protected HatchStyle(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo

SerializationInfo

context StreamingContext

StreamingContext

Properties

ContextMenu

Must be overridden, when Flags contains PropertyEntryType.ContextMenu. See ContextMenu

public override MenuWithHandler[] ContextMenu { get; }

Property Value

MenuWithHandler[]

Flags

Implementation of Flags: the derived class states what the entry is and what the user can do with it. The flags must match the overridden members, e.g. HasSubEntries requires SubItems, ValueEditable requires Value and EndEdit(bool, bool, string), DropDown requires GetDropDownList() and ListBoxSelected(int).

public override PropertyEntryType Flags { get; }

Property Value

PropertyEntryType

LabelText

An explicit label text. When set (not null) it is shown instead of the text from the StringTable; use it for entries whose label is not a fixed resource string, e.g. the name of an item. Call Refresh() after changing it while the entry is displayed.

public override string LabelText { get; }

Property Value

string

Name

Gets or sets the name of the HatchStyle

public string Name { get; set; }

Property Value

string

Parent

The HatchStyleList that contains this hatch style, or null when it is not in a list. The list sets it when the style is added. Assigning a list of another type stores null. Hides the untyped Parent.

public IAttributeList Parent { get; set; }

Property Value

IAttributeList

Methods

Clone()

Creates a copy of this hatch style of the same type, with the same name and the same settings. The copy refers to the same colour, line width and line pattern objects and is not contained in a list. Used when a HatchStyleList is cloned and when hatch styles are copied between the project and the global settings.

public abstract HatchStyle Clone()

Returns

HatchStyle

the copy

EditTextChanged(string)

May be overridden when Flags contains PropertyEntryType.ValueEditable. See EditTextChanged(string),

public override bool EditTextChanged(string newValue)

Parameters

newValue string

Returns

bool

EndEdit(bool, bool, string)

Must be overridden when Flags contains PropertyEntryType.ValueEditable. See EndEdit(bool, bool, string)

public override void EndEdit(bool aborted, bool modified, string newValue)

Parameters

aborted bool
modified bool
newValue string

FireDidChange(string, object)

Notifies the containing HatchStyleList (and through it the Project or the Settings) that a property of this hatch style has been changed, so that the change can be undone and the hatches using this style can be updated. Derived classes call it after they changed a property. Does nothing when the style is not in a list.

protected void FireDidChange(string propertyName, object propertyOldValue)

Parameters

propertyName string

name of the public property that was changed, used by the undo mechanism to restore the old value

propertyOldValue object

the value of the property before the change

GenerateContent(CompoundShape, Plane)

Generates the lines or other GeoObjects that fill out the given shape in the given plane. Derived classes must override this method. Default implementation returns null.

public virtual GeoObjectList GenerateContent(CompoundShape shape, Plane plane)

Parameters

shape CompoundShape

The shape to be filled

plane Plane

The plane of the shape

Returns

GeoObjectList

The resulting GeoObjects or null

GetObjectData(SerializationInfo, StreamingContext)

Writes the data of this object for the legacy binary serialization (ISerializable). Files are written in the JSON format (IJsonSerialize) now; the binary format is still read.

public void GetObjectData(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo

receives the data

context StreamingContext

the destination of the serialization

GetShowProperty()

Returns an object to display the properties of the HatchStyle

public abstract IShowProperty GetShowProperty()

Returns

IShowProperty