Table of Contents

Class AttributeListContainer

Namespace
CADability.Attribute
Assembly
CADability.dll

static functions to manage IAttributeListContainer and IAttributeList objects

public class AttributeListContainer
Inheritance
AttributeListContainer
Inherited Members

Constructors

AttributeListContainer()

There is no need to create an instance: the class only has static methods.

public AttributeListContainer()

Methods

CloneAttributeList(IAttributeListContainer, IAttributeListContainer, string, bool)

Gives the container To a copy of the attribute list with the given name. The list is cloned from From when that container has one; otherwise a new empty list of the standard type belonging to the name ("ColorList", "LayerList", "HatchStyleList", "DimensionStyleList", "LineWidthList", "LinePatternList" or "StyleList") is created. A new Project gets its lists this way from the global Settings.

public static bool CloneAttributeList(IAttributeListContainer From, IAttributeListContainer To, string ListName, bool Initialize)

Parameters

From IAttributeListContainer

the container to copy the list from; may be null

To IAttributeListContainer

the container that receives the list; must not already have a list with that name

ListName string

the key of the list

Initialize bool

true: fill a newly created list with its default entries (Initialize())

Returns

bool

true when a list was added, false when From has no such list and the name is not one of the standard lists

IncludeAttributeList(IAttributeListContainer, IAttributeListContainer, string, bool)

Adds the entries of the list named ListName of Included to the list with the same name of Including, skipping the names that already exist there. When something was added, the lists of Including are made consistent with UpdateLists(IAttributeListContainer, bool).

public static bool IncludeAttributeList(IAttributeListContainer Including, IAttributeListContainer Included, string ListName, bool Initialize)

Parameters

Including IAttributeListContainer

the container whose list is extended

Included IAttributeListContainer

the container that provides the entries

ListName string

the key of the list, e.g. "LayerList"

Initialize bool

not used

Returns

bool

true when at least one entry was added, false when nothing was added or one of the containers or lists does not exist

UpdateLists(IAttributeListContainer, bool)

Makes the cross references between the lists of a container consistent: every attribute that refers to another attribute (e.g. a Style to a Layer, a HatchStyleLines to a ColorDef) is made to refer to the entry with the same name in the corresponding list of the container (see Update(bool)). Called after a project has been loaded or created.

public static void UpdateLists(IAttributeListContainer container, bool AddMissingToList)

Parameters

container IAttributeListContainer

the container whose lists are updated; null is ignored

AddMissingToList bool

true: a referenced attribute that is not found in the list is added to it, false: the reference is left as it is

UpdateObjectAttrinutes(IAttributeListContainer, IGeoObject)

Replaces the attributes of an object (and of its direct children) by the entries with the same name in the lists of the container, or adds the attributes to the lists when there is no such entry (see Update(IGeoObject)). Called when objects from another project are inserted, e.g. by paste or drag and drop, so that they share the attributes of the project. The name of the method keeps its historical misspelling.

public static void UpdateObjectAttrinutes(IAttributeListContainer container, IGeoObject Object2Update)

Parameters

container IAttributeListContainer

the container with the lists, usually the project; null is ignored

Object2Update IGeoObject

the object to update