Table of Contents

Class LinePatternList

Namespace
CADability.Attribute
Assembly
CADability.dll

The list of LinePattern attributes (dash patterns) available in a Project or in the global Settings. The entries are identified by their unique names, one of them is the current pattern that newly constructed objects get, and the list is shown as an editable group in the control center. A new project gets a clone of the global default list.

public class LinePatternList : IShowPropertyImpl, IShowProperty, IPropertyEntry, IAttributeList, ISerializable, ICommandHandler, IDeserializationCallback
Inheritance
LinePatternList
Implements
Inherited Members

Constructors

LinePatternList()

Constructs an empty LinePatternList. Usually you dont have to construct a LinePatternList since on construction of a new Project the global LinePatternList is cloned and set as the projects LinePatternList.

public LinePatternList()

LinePatternList(SerializationInfo, StreamingContext)

Constructor required by deserialization

protected LinePatternList(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo

SerializationInfo

context StreamingContext

StreamingContext

Properties

ContextMenu

Implementation of ContextMenu: the default returns null. An entry whose LabelType contains ContextMenu must override it.

public override MenuWithHandler[] ContextMenu { get; }

Property Value

MenuWithHandler[]

Count

Gets the number of entities in this list.

public int Count { get; }

Property Value

int

Current

Gets or sets the current LinePattern. The current LinePattern is used when a new GeoObject is constructed interactively.

public LinePattern Current { get; set; }

Property Value

LinePattern

EntryType

Overrides EntryType, returns GroupTitle.

public override ShowPropertyEntryType EntryType { get; }

Property Value

ShowPropertyEntryType

this[int]

Returns the line pattern with the given index.

public LinePattern this[int Index] { get; }

Parameters

Index int

index of required laine pattern

Property Value

LinePattern

line pattern

LabelType

How the label of this entry behaves (see ShowPropertyLabelFlags): whether it can be selected or edited, is bold or has a context menu. The default implementation returns Selectable.

public override ShowPropertyLabelFlags LabelType { get; }

Property Value

ShowPropertyLabelFlags

SubEntries

The sub entries shown below this entry when it is opened in the property page. The default implementation has none and returns an empty array.

public override IShowProperty[] SubEntries { get; }

Property Value

IShowProperty[]

SubEntriesCount

The number of SubEntries, 0 for an entry that cannot be opened. The default implementation returns 0.

public override int SubEntriesCount { get; }

Property Value

int

Methods

Add(LinePattern)

Adds an LinePattern object to the list. Throws a NameAlreadyExistsException if there is a LinePattern with the given name in the list. This also prevents the same object added twice to the list.

public void Add(LinePattern linePatternToAdd)

Parameters

linePatternToAdd LinePattern

LinePattern to Add

Added(IPropertyPage)

Implementation of Added(IPropertyPage): memorizes the property page in propertyPage. Unlike Added(IPropertyTreeView) it does not raise the state changed event. Override it to subscribe to events while the entry is displayed, and call the base implementation.

public override void Added(IPropertyPage pp)

Parameters

pp IPropertyPage

the property page the entry was added to

Clone()

Returns a copy of this LinePatternList. The entries are cloned so the copy is independant.

public LinePatternList Clone()

Returns

LinePatternList

CreateOrFind(string, params double[])

Returns the line pattern with the given name; when there is none, a new LinePattern with that name and the given stroke/gap lengths (see LinePattern(string, params double[]), layout scaling) is added to the list and returned. The pattern of an existing entry is left as it is.

public LinePattern CreateOrFind(string Name, params double[] pattern)

Parameters

Name string

the name of the line pattern

pattern double[]

alternating stroke and gap lengths for a newly created entry; empty for a solid line

Returns

LinePattern

the existing or newly created LinePattern

Find(string)

Returns the LinePattern with the given name or null if not found.

public LinePattern Find(string name)

Parameters

name string

Name of the requsetd LinePattern

Returns

LinePattern

FindIndex(LinePattern)

Returns the index of the given line pattern or -1 if not in the list

public int FindIndex(LinePattern lp)

Parameters

lp LinePattern

line pattern whos index is required

Returns

int

the index found or -1 if not found

GetDefault()

Creates a default LinePatternList.

public static LinePatternList GetDefault()

Returns

LinePatternList

Remove(LinePattern)

Removes an entry from the LinePattern list. Depending on the context and global settings there might be a warning if the LinePattern is beeing used by an IGeoObject belonging to the Project. If the LinePattern is not in the list, nothing happens.

public void Remove(LinePattern linePatternToRemove)

Parameters

linePatternToRemove LinePattern

LinePattern to remove

Removed(IPropertyPage)

Implementation of Removed(IPropertyPage): forgets the property page. Override it to unsubscribe from events, and call the base implementation.

public override void Removed(IPropertyPage pp)

Parameters

pp IPropertyPage

the property page the entry was removed from

Events

DidModifyEvent

Raised when a line pattern is added to or removed from the list. Changes of the properties of a line pattern are forwarded to the owner of the list (the project) instead.

public event DidModifyDelegate DidModifyEvent

Event Type

DidModifyDelegate