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
DimensionStyleList
The list of dimension styles of this container (key "DimensionStyleList").
DimensionStyleList DimensionStyleList { get; }
Property Value
HatchStyleList
The list of hatch styles of this container (key "HatchStyleList").
HatchStyleList HatchStyleList { get; }
Property Value
LayerList
The list of layers of this container (key "LayerList").
LayerList LayerList { get; }
Property Value
LinePatternList
The list of line patterns of this container (key "LinePatternList").
LinePatternList LinePatternList { get; }
Property Value
LineWidthList
The list of line widths of this container (key "LineWidthList").
LineWidthList LineWidthList { get; }
Property Value
ListCount
The number of attribute lists in this container.
int ListCount { get; }
Property Value
StyleList
The list of styles of this container (key "StyleList").
StyleList StyleList { get; }
Property Value
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
KeyNamestringthe key, unique within the container
ToAddIAttributeListthe 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
listIAttributeListthe list containing the attribute
attributeINamedAttributethe attribute that was changed
changeReversibleChangedescribes 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
KeyNamestringthe 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
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
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
KeyNamestringthe 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
listIAttributeListthe list that wants to remove the attribute
attributeINamedAttributethe attribute to be removed
resourceIdstringprefix 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
listIAttributeListthe list to complete