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
infoSerializationInfoSerializationInfo
contextStreamingContextStreamingContext
Properties
ContextMenu
Must be overridden, when Flags contains PropertyEntryType.ContextMenu. See ContextMenu
public override MenuWithHandler[] ContextMenu { get; }
Property Value
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
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
Name
Gets or sets the name of the HatchStyle
public string Name { get; set; }
Property Value
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
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
newValuestring
Returns
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
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
propertyNamestringname of the public property that was changed, used by the undo mechanism to restore the old value
propertyOldValueobjectthe 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
shapeCompoundShapeThe shape to be filled
planePlaneThe 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
infoSerializationInforeceives the data
contextStreamingContextthe destination of the serialization
GetShowProperty()
Returns an object to display the properties of the HatchStyle
public abstract IShowProperty GetShowProperty()