Exemple #1
0
        private static StorableTypeMetadata StorableTypeLayoutToMetadata(StorableTypeLayout layout, Mapper mapper)
        {
            var metadata = new StorableTypeMetadata();

            metadata.Names.AddRange(layout.MemberNames.Select(name => mapper.GetStringId(name)));
            metadata.TypeGuid = mapper.GetStringId(layout.TypeGuid);
            metadata.Parent   = layout.ParentLayoutId;
            return(metadata);
        }
Exemple #2
0
        private static StorableTypeLayout StorableTypeMetadataToLayout(StorableTypeMetadata box, Mapper mapper)
        {
            var layout = new StorableTypeLayout();

            layout.TypeGuid       = mapper.GetString(box.TypeGuid);
            layout.MemberNames    = box.Names.Select(sId => mapper.GetString(sId)).ToList();
            layout.ParentLayoutId = box.Parent;
            layout.IsPopulated    = true;
            return(layout);
        }
Exemple #3
0
 internal uint GetStorableTypeMetadata(string typeGuid)
 {
     if (!type2layout.TryGetValue(typeGuid, out StorableTypeLayout layout))
     {
         layout          = new StorableTypeLayout();
         layout.TypeGuid = typeGuid.ToString().ToUpperInvariant();
         type2layout.Add(typeGuid, layout);
         return(storableTypeLayouts.GetIndex(layout)); // add to index for storage
     }
     return(storableTypeLayouts.GetIndex(layout));
 }
Exemple #4
0
 internal uint GetStorableTypeLayoutId(StorableTypeLayout layout)
 {
     return(storableTypeLayouts.GetIndex(layout));
 }