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); }
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); }
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)); }
internal uint GetStorableTypeLayoutId(StorableTypeLayout layout) { return(storableTypeLayouts.GetIndex(layout)); }