Article | 60001528 |
Type | Wish |
Product | Engine |
Version | 6022 |
Date Added | 10/27/2011 |
Fixed | Yes [4/26/2012] |
Submitted by | alessio |
Keywords |
In version 6023 a new property UserTables was added for vdDocument object
Get the user defined table collection. Used to store application specific user data
You can set user value properties to any of the following type values:
String Double Int32 Boolean Byte Int16 Int64 UInt16 UInt64 UInt32 Single ushort Enum System.Color VectorDraw.Serialize.IVDHandle
or any object that implents IVDSerialise interface like default VectorDraw objects(vdFigure , vdPrimary , ByteArray , DoubleArray gPoint gPoints etc.)
By default the collection is empty.
The object is saved with vdml / vdcl format
Undo is not supported for VectorDraw.Professional.Table.vdTables object.
Example:
//group some user property values
int Int_value = 1;
double double_value = 1.0d;
string string_value = "some string data";
ByteArray bytearray_value = new ByteArray(new byte[] { 1, 2, 3, 4 });
gPoint gpoint_value = new gPoint(1, 2, 3);
gPoints gpoints_value = new gPoints(new gPoint[] { new gPoint(1, 2, 3), new gPoint(4, 5, 6) });
doc.UserTables["Table1"]["Table1_GroupProperties1"]["Integer_Property"] = Int_value;
doc.UserTables["Table1"]["Table1_GroupProperties1"]["Double_Property"] = double_value;
doc.UserTables["Table1"]["Table1_GroupProperties1"]["String_Property"] = string_value;
doc.UserTables["Table1"]["Table1_GroupProperties1"]["ByteArray_Property"] = bytearray_value;
doc.UserTables["Table2"]["Table2_GroupProperties1"]["gpoint_value"] = gpoint_value;
doc.UserTables["Table2"]["Table2_GroupProperties2"]["gpoints_value"] = gpoints_value;
//read the user property values that stored before
Int_value = (int)doc.UserTables["Table1"]["Table1_GroupProperties1"]["Integer_Property"];
double_value = (double)doc.UserTables["Table1"]["Table1_GroupProperties1"]["Double_Property"] ;
string_value = (string)doc.UserTables["Table1"]["Table1_GroupProperties1"]["String_Property"];
bytearray_value = (ByteArray)doc.UserTables["Table1"]["Table1_GroupProperties1"]["ByteArray_Property"];
gpoint_value = (gPoint)doc.UserTables["Table2"]["Table2_GroupProperties1"]["gpoint_value"];
gpoints_value = (gPoints) doc.UserTables["Table2"]["Table2_GroupProperties2"]["gpoints_value"];