public static void Serialize(SimplifiedSchema schema, string location) { BinaryFormatter serializer = new BinaryFormatter(); using (FileStream fs = new FileStream(location, FileMode.Create)) { serializer.Serialize(fs, schema); } }
public static List <SimplifiedSchemaObject> GetComplexTypesFromSchema(long implementationGuideTypeId) { using (TemplateDatabaseDataSource tdb = new TemplateDatabaseDataSource()) { ImplementationGuideType igType = tdb.ImplementationGuideTypes.Single(y => y.Id == implementationGuideTypeId); SimplifiedSchema schema = new SimplifiedSchema( Helper.GetIGSchema(igType)); return(schema.ComplexTypes); } }
public SimplifiedSchema GetSchemaFromContext(ContextTypes contextType, string context) { SimplifiedSchemaObject foundObject = null; if (contextType == ContextTypes.ComplexType) { foundObject = GetFromComplexType(context); } else if (contextType == ContextTypes.XPath) { foundObject = GetFromXpath(context); } if (foundObject != null) { SimplifiedSchema schema = new SimplifiedSchema(); schema.Children.Add(foundObject); return(schema); } return(null); }