Class vdXProperties
- Namespace
- VectorDraw.Professional.vdCollections
- Assembly
- VectorDraw.Professional.dll
Represents a collection of extended properties (vdXProperty) used by VectorDraw objects. Typically, a vdXProperties collection is used to store application-defined extended properties for a XProperties of a vdPrimary object, but it can be used by any object that needs to store extended properties.
public sealed class vdXProperties : vdBaseObject, IDisposable, IVDSerialise, IEnumerable, IBaseObject
- Inheritance
-
vdXProperties
- Implements
- Inherited Members
Examples
//Add some xproperties to an entity and transform it with a transformation that will transform the property value also
vdLine line1 = new vdLine(doc, new gPoint(0.0, 0.0, 0.0), new gPoint(10.0, 10.0, 0.0));
var prop = line1.XProperties.Add("transformedPoint");
prop.PropValue = new gPoint(5.0, 5.0, 0.0);
prop.TransformID = VectorDraw.Professional.vdObjects.vdXProperty.TransformationType.WorldSpacePosition; //this will make the property to be transformed when the entity is transformed
line1.XProperties["mydatastring"] = "This is a line entity";
line1.XProperties["integerValue"] = 1024;
doc.Model.Entities.AddItem(line1);
//offset the line and see the effect on the xproperty value
Matrix mat = new Matrix();
mat.TranslateMatrix(new gPoint(5.0, 5.0, 0.0));
line1.Transformby(mat);
//read the xproperties value after the transformation and see that the transformedPoint value is also transformed by the same matrix as the line entity
string str = "";
foreach (vdXProperty item in line1.XProperties)
{
str += item.Name + " = " + item.PropValue.ToString() + "\n";
}
MessageBox.Show(str);
Remarks
The vdXProperties collection stores application-defined extended properties and provides fast lookup by name using internal dictionaries. Multiple properties with the same name are supported .
Constructors
- vdXProperties()
Initializes the vdXProperties collection object.
Properties
- Count
Get the item's count of the collection.
- this[int]
Get a vdXProperty object from the collection at a specified index.
- this[string]
Get/Set the PropValue of the first ocurrence vdXProperty with specific name.
- ItemType
Returns the Type of Items in the collection
- Last
Returns the last item in the collection.
Methods
- Add(object)
Adds an object to the end of the collection.
- Add(string)
Creates and adds a vdXProperty object to the collection with the specified name.
- Add(string, object)
Create and add a new vdXproperty with the given parameters.
- AddItem(object)
Adds an object to the collection.
- AddItem(string, string)
Create and add a new vdXproperty with the given parameters.
- AddItem(vdXProperty)
Adds a vdXProperty object to the collection.
- ChangeOrder(vdXProperty, bool)
Changes the position of a vdXProperty object to the front or the end of the collection.
- ClearIndexDictionary()
Clears the Index of the Dictionary. Internally used to speed up Swap method.
- DeSerialize(DeSerializer, string, object)
This Function is called foreach field name of the vdXproperties object when opening in vdml format.
- Dispose()
Releases all resources used by this object.
- FindItem(object)
Checks if an object exists in the collection.
- FindItem(vdXProperty)
Checks if an object exists in the collection.
- FindName(string)
Search the collection for a vdXProperty with a specified name.
- GetEnumerator()
Implements the "foreach" expression for the collection.
- GetFilterData(string)
Search the collection for vdXProperty objects with a specified name.
- GetNames()
Gets all the names of the vdXProperty objects of the collection.
- GetNotDeletedItems()
Get all non deleted objects of the collection.
- GetObjectRealPosition(object)
Find the index where a specified object is located in the list.
- GetSortedXproperties()
Returns a new vdXpropertis collection containing all the xproperties of this collection with sorted names usefull when exporting to DXF format.
- GetTableDependecies(vdTableDependeciesArgs)
Fills the passed vdTableDependeciesArgs args with all the table references of this object (vdLayer, vdBlock, vdDimstyle, vdLineType, vdTextstyle, vdImageDef, vdHatchPattern etc).
- InsertAt(int, object)
Insert an object at a specified index.
- InsertAt(int, vdXProperty)
Insert a vdXProperty object to a specified index of the collection.
- InternalSetOwner(vdBaseObject)
Internally used only.
Set the object owner
- MakeIndexDictionary()
Creates an Index of the Dictionary. Internally used to speed up Swap method.
- RemoveAll()
Removes all objects from the collection.
- RemoveAt(int)
Removes an object from the specified index of the collection.
- RemoveItem(object)
Removes an object from the collection.
- RemoveItem(vdXProperty)
Removes a specific vdXProperty object from the collection.
- Serialize(Serializer)
This Function is called when saving the vdXProperties object to vdml format.
- ToString()
Gets a System.String that represents the count of the vdXProperties collection Object.
- Transformby(Matrix)
Transforms all the geometrical properties of the object with the specific Matrix mat.
- getUniqueTableName(string)
Creates a unique string for use as name to a vdXProperty object.
- swap(vdXProperty, vdXProperty)
Swaps the position between two different vdXProperty objects existing in the collection.