Class DimensionStyleList
- Namespace
- CADability.Attribute
- Assembly
- CADability.dll
The DimensionStyleList contains the list of available dimension styles (DimensionStyle). It is owned by the project or the global settings. It implements IShowProperty to make it available in the tree voew of the control center.
public class DimensionStyleList : IShowPropertyImpl, IShowProperty, IPropertyEntry, ISerializable, ICommandHandler, IAttributeList, IDeserializationCallback
- Inheritance
-
DimensionStyleList
- Implements
- Inherited Members
Constructors
DimensionStyleList()
Creates an empty list that belongs to no project or settings (Owner is null). Applications normally do not create lists themselves but use DimensionStyleList or DimensionStyleList of GlobalSettings.
public DimensionStyleList()
DimensionStyleList(SerializationInfo, StreamingContext)
Constructor required by deserialization
protected DimensionStyleList(SerializationInfo info, StreamingContext context)
Parameters
infoSerializationInfoSerializationInfo
contextStreamingContextStreamingContext
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
Count
The number of dimension styles in the list.
public int Count { get; }
Property Value
Current
The dimension style used for newly created dimensions: the Project assigns it to a Dimension that is added without a style, and the property grid shows it in bold. When no current style has been set, the first entry is returned; null for an empty list. Setting it does not raise DidModifyEvent.
public DimensionStyle Current { get; set; }
Property Value
EntryType
Overrides EntryType, returns GroupTitle.
public override ShowPropertyEntryType EntryType { get; }
Property Value
this[int]
Returns the dimension style at the given position. The entries are kept in alphabetical order of their names, so the index of a style changes when styles are added, removed or renamed.
public DimensionStyle this[int Index] { get; }
Parameters
Property Value
- DimensionStyle
The dimension style at that position
Exceptions
- ArgumentOutOfRangeException
When
Indexis outside the list
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
Owner
The Project or Settings this list belongs to, null for a standalone list. The owner provides the ColorList, LineWidthList and other attribute lists the styles refer to, is asked before a style is removed (it refuses to remove the last style and asks the user when the style is still in use) and is informed about changes to the styles.
public IAttributeListContainer Owner { get; set; }
Property Value
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
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
Methods
Add(DimensionStyle)
Add a dimensionstyle to the list. If there is already a dimension styl with the same name in the list, the NameAlreadyExistsException will be thrown.
public void Add(DimensionStyle ToAdd)
Parameters
ToAddDimensionStyledimension style to add
Find(string)
public DimensionStyle Find(string Name)
Parameters
Namestring
Returns
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
Remove(DimensionStyle)
The dimensionstyle ToRemove will be removed from the list. If there is no such dimension style, nothing will be changed.
public void Remove(DimensionStyle ToRemove)
Parameters
ToRemoveDimensionStyle
Events
DidModifyEvent
Raised when a style has been added to the list (Add(DimensionStyle)) or after a call to Remove(DimensionStyle), also when nothing was removed. The handler gets this list as sender and null as arguments. Changes to the properties of a single style are reported through PropertyChangedEvent instead.
public event DidModifyDelegate DidModifyEvent