示例#1
0
        public IndexSub(Schema schema, string type)
        {
            // Record Details
            this.Schema = schema;
            this.type = type;

            // Load subschema
            subschema = Schema.Types[type];

            // Reset
            Reset();
        }
示例#2
0
        public static Schema FromJson(string v)
        {
            Schema output = new Schema();
            Dictionary<string, SchemaType> types;

            // Deserialise
            try {
                types = Util.JsonDeserialize<Dictionary<string, SchemaType>>(v);
            } catch (Exception e) {
                throw new DeserialisationException("Failed to deserialise Schema", e);
            }
            output.Types = types;
            output.Hash = Util.Hash(v);
            return output;
        }
示例#3
0
 public Index(Schema schema)
 {
     foreach (var type in schema.Types) {
         Subindexes[type.Key] = new IndexSub(schema, type.Key);
     }
 }