Prod.: Engine, ver.: 6022, ID: 60001528, Wish : User defined Table to store application specific user data

Wish : User defined Table to store application specific user data

Article60001528
TypeWish
ProductEngine
Version6022
Date Added10/27/2011
FixedYes [4/26/2012]
Submitted byalessio
Keywords

Subject

User defined Table to store application specific user data

Summary

User defined Table to store application specific user data

Solution


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"];