Table of Contents

Interface IAttributeListContainer

Namespace
CADability.Attribute
Assembly
CADability.dll

Interface implemented by Project and Settings. Helps to get all kind of attribute lists, e.g. ColorList, LayerList

public interface IAttributeListContainer

Properties

ColorList

The list of colours of this container (key "ColorList").

ColorList ColorList { get; }

Property Value

ColorList

DimensionStyleList

The list of dimension styles of this container (key "DimensionStyleList").

DimensionStyleList DimensionStyleList { get; }

Property Value

DimensionStyleList

HatchStyleList

The list of hatch styles of this container (key "HatchStyleList").

HatchStyleList HatchStyleList { get; }

Property Value

HatchStyleList

LayerList

The list of layers of this container (key "LayerList").

LayerList LayerList { get; }

Property Value

LayerList

LinePatternList

The list of line patterns of this container (key "LinePatternList").

LinePatternList LinePatternList { get; }

Property Value

LinePatternList

LineWidthList

The list of line widths of this container (key "LineWidthList").

LineWidthList LineWidthList { get; }

Property Value

LineWidthList

ListCount

The number of attribute lists in this container.

int ListCount { get; }

Property Value

int

StyleList

The list of styles of this container (key "StyleList").

StyleList StyleList { get; }

Property Value

StyleList

Methods

Add(string, IAttributeList)

Registers an attribute list under the given key and makes this container its Owner. Throws an AttributeException when the key is already in use.

void Add(string KeyName, IAttributeList ToAdd)

Parameters

KeyName string

the key, unique within the container

ToAdd IAttributeList

the list to add; null is ignored

AttributeChanged(IAttributeList, INamedAttribute, ReversibleChange)

Called by an attribute list when a property of one of its attributes was changed (e.g. the RGB value of a colour, the visibility of a layer). The project refreshes the objects that use the attribute, the settings mark themselves as modified. Not meant to be called by applications.

void AttributeChanged(IAttributeList list, INamedAttribute attribute, ReversibleChange change)

Parameters

list IAttributeList

the list containing the attribute

attribute INamedAttribute

the attribute that was changed

change ReversibleChange

describes the change and can undo it

GetList(string)

Returns the attribute list registered under the given key. The standard lists use the keys "ColorList", "LayerList", "HatchStyleList", "DimensionStyleList", "LineWidthList", "LinePatternList" and "StyleList"; applications may add lists under their own keys with Add(string, IAttributeList).

IAttributeList GetList(string KeyName)

Parameters

KeyName string

the key of the list

Returns

IAttributeList

the list, or null when there is no list with that key

List(int)

Returns the attribute list at the given position, to enumerate all lists together with ListCount and ListKeyName(int).

IAttributeList List(int KeyIndex)

Parameters

KeyIndex int

index in the range 0 to ListCount-1

Returns

IAttributeList

the list, or null when the index is out of range

ListKeyName(int)

Returns the key under which the list at the given position is registered.

string ListKeyName(int KeyIndex)

Parameters

KeyIndex int

index in the range 0 to ListCount-1

Returns

string

the key, or null when the index is out of range

Remove(string)

Removes the attribute list with the given key. The Project throws an AttributeException when one of the standard lists is to be removed.

void Remove(string KeyName)

Parameters

KeyName string

the key of the list to remove

RemovingItem(IAttributeList, INamedAttribute, string)

Called by an attribute list before it removes an attribute, to give the container the chance to veto. The project and the settings refuse to remove the last entry of a list; the project additionally lets the user decide when the attribute is still used by objects of a model.

bool RemovingItem(IAttributeList list, INamedAttribute attribute, string resourceId)

Parameters

list IAttributeList

the list that wants to remove the attribute

attribute INamedAttribute

the attribute to be removed

resourceId string

prefix of the string table entries for the messages shown to the user, e.g. "LayerList"

Returns

bool

true when the attribute may be removed, false to keep it

UpdateList(IAttributeList)

Adds all attributes used by the objects in the models of the container to the given list, provided they are of the type the list holds. The settings, which have no models, do nothing.

void UpdateList(IAttributeList list)

Parameters

list IAttributeList

the list to complete