示例#1
0
        public static SpecRecord CreateRecordFromSpec(ISpec spec)
        {
            string json_text = JsonConvert.SerializeObject(spec);
            var    record    = new SpecRecord(spec, json_text);

            return(record);
        }
示例#2
0
        private static ISpec DeserializeSpecification(SpecRecord record)
        {
            switch (record.SpecType)
            {
            case "warping":
                return(JsonConvert.DeserializeObject <WarpingSpecification>(record.JsonText));

            case "style":
                return(JsonConvert.DeserializeObject <StyleSpecification>(record.JsonText));

            default:
                return(null);
            }
        }
示例#3
0
 public static ISpec CreateSpecFromRecord(SpecRecord record)
 {
     return(DeserializeSpecification(record));
 }
示例#4
0
        public static SpecRecord CreateSpecRecordFromList(List <string> list)
        {
            var record = new SpecRecord(list);

            return(record);
        }
示例#5
0
        public static SpecRecord CreateSpecRecordFromReader(SQLiteDataReader reader)
        {
            var record = new SpecRecord(reader);

            return(record);
        }
示例#6
0
        public static SpecRecord CreateSpecRecord()
        {
            var record = new SpecRecord();

            return(record);
        }
示例#7
0
        private ISpec GetDefaultSpec(string material_id)
        {
            SpecRecord record = DataAccess.SelectSingleRecord("standard_specifications", "Material_Id", material_id);

            return(Factory.CreateSpecFromRecord(record));
        }