コード例 #1
0
        public static void Serialize(SimplifiedSchema schema, string location)
        {
            BinaryFormatter serializer = new BinaryFormatter();

            using (FileStream fs = new FileStream(location, FileMode.Create))
            {
                serializer.Serialize(fs, schema);
            }
        }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
        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);
        }