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
FromIAttributeListContainerthe container to copy the list from; may be null
ToIAttributeListContainerthe container that receives the list; must not already have a list with that name
ListNamestringthe key of the list
Initializebooltrue: fill a newly created list with its default entries (Initialize())
Returns
- bool
true when a list was added, false when
Fromhas 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
IncludingIAttributeListContainerthe container whose list is extended
IncludedIAttributeListContainerthe container that provides the entries
ListNamestringthe key of the list, e.g. "LayerList"
Initializeboolnot 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
containerIAttributeListContainerthe container whose lists are updated; null is ignored
AddMissingToListbooltrue: 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
containerIAttributeListContainerthe container with the lists, usually the project; null is ignored
Object2UpdateIGeoObjectthe object to update