1,285 bytes added,
16:08, 20 May 2015 {{Item/Resources/CodeSnippetHeader}}
=== Create MetaProperty ===
{{Item/Resources/CodeSnippetInfo|KNO}}
<syntaxhighlight lang="csharp">
// Meta class: CUSTOMMETAPROPERTY
Guid idCUSTOMMETAPROPERTY = new Guid("6f77ec1c-9049-44ba-8e64-1556050326e0");
MetaClass mcCUSTOMMETAPROPERTY = obj.Environment.UBIKDataFactory().MetaClass(idCUSTOMMETAPROPERTY);
// Create a new instance of CUSTOMMETAPROPERTY
// (UI: new instance using Bulk Editor)
MetaProperty newMetaProp1 = (MetaProperty)mcCUSTOMMETAPROPERTY.CreateNewInstance();
MetaProperty newMetaProp2 = (MetaProperty)mcCUSTOMMETAPROPERTY.CreateNewInstance();
// A meta property needs to configured, for example
// Name, Description, Namespace
// DataType
// SelectiveList, Reference, ...
newMetaProp1.Name="MYPROP_INT_1";
newMetaProp1.Description = "My new integer property 1";
newMetaProp2.Name="MYPROP_INT_2";
newMetaProp2.Description = "My new integer property 2";
// See UBIK Class Documentation for more PropertyTypes
newMetaProp1.TrySetValue<int>("TYPE", (int)UBIK.Kernel.PropertyTypes.Int);
newMetaProp2.TrySetValue<int>("TYPE", (int)UBIK.Kernel.PropertyTypes.Int);
newMetaProp1.Save();
newMetaProp2.Save();
</syntaxhighlight>
[[Category:Internal resources]]