public static SpecRecord CreateRecordFromSpec(ISpec spec) { string json_text = JsonConvert.SerializeObject(spec); var record = new SpecRecord(spec, json_text); return(record); }
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); } }
public static ISpec CreateSpecFromRecord(SpecRecord record) { return(DeserializeSpecification(record)); }
public static SpecRecord CreateSpecRecordFromList(List <string> list) { var record = new SpecRecord(list); return(record); }
public static SpecRecord CreateSpecRecordFromReader(SQLiteDataReader reader) { var record = new SpecRecord(reader); return(record); }
public static SpecRecord CreateSpecRecord() { var record = new SpecRecord(); return(record); }
private ISpec GetDefaultSpec(string material_id) { SpecRecord record = DataAccess.SelectSingleRecord("standard_specifications", "Material_Id", material_id); return(Factory.CreateSpecFromRecord(record)); }