/// <summary>
 /// Create Persistent Schema Elements
 /// </summary>
 /// <param name="collection"></param>
 /// <param name="schemaElements"></param>
 /// <param name="dataElements"></param>
 public static void CreatePersistentSchemaElements(this IPropertySetCollection collection, out List <PersistentSchemaElement> schemaElements,
                                                   out List <PersistentPropertyElement> dataElements)
 {
     schemaElements = new List <PersistentSchemaElement>();
     dataElements   = new List <PersistentPropertyElement>();
     foreach (var schema in collection.Schemas.Schemas)
     {
         SchemaJsonSerializationVisitor visitor = new SchemaJsonSerializationVisitor();
         schema.Value.Accept(visitor);
         PersistentSchemaElement se = new PersistentSchemaElement
         {
             SchemaName        = schema.Key,
             SchemaType        = visitor.SchemaType.ToString(),
             SchemaBody        = visitor.JsonValue,
             SerializationHint = (int)visitor.Hint
         };
         schemaElements.Add(se);
     }
     foreach (string k in collection.Keys)
     {
         PersistentPropertyElement element = new PersistentPropertyElement
         {
             Name = k
         };
         ValueSerializationTarget target = new ValueSerializationTarget(element);
         collection.Schemas.GetSchema(k).Serializer.Serialize(collection[k], target);
         dataElements.Add(element);
     }
 }
 public void CopyFrom(PersistentPropertyElement sourceElement)
 {
     StringValue   = sourceElement.StringValue;
     IntValue      = sourceElement.IntValue;
     LongValue     = sourceElement.LongValue;
     DoubleValue   = sourceElement.DoubleValue;
     DateTimeValue = sourceElement.DateTimeValue;
     RawValue      = sourceElement.RawValue;
 }
 public ValueSerializationTarget(PersistentPropertyElement element)
 {
     _element = element;
 }