Exemplo n.º 1
0
        public static Dictionary<string, object> GetProperties(this UserDefinedDef userDefinedDef, ComplexDefContext complexDefContext)
        {
            var properties = new Dictionary<string, object>();
            var typeInfo = complexDefContext.TypeInfos.Find(x => x.Id == userDefinedDef.TypeInfoId);

            var names = userDefinedDef.Names;
            var values = userDefinedDef.Values;

            for (var i = 0; i < names.Count; i++)
                properties.Add(typeInfo.PropertyIndexName[names[i]], values[i]);

            return properties;
        }
Exemplo n.º 2
0
 private byte[] WriteComplexDefContext(ComplexDefContext complexDefContext)
 {
     using (var simpleTypeWriter = new SimpleTypeWriter(_simpleTypeHelper, _encoding))
     {
         simpleTypeWriter.Write(DefMark.ComplexType);
         WriteTypeInfos(simpleTypeWriter, complexDefContext.TypeInfos);
         WriteComplexTypeDefs(simpleTypeWriter, complexDefContext.ComplexTypeDefs);
         return simpleTypeWriter.ToArray();
     }
 }