Exemplo n.º 1
0
        /// <summary>
        /// Check to see if schema is already loaded into the currently active model
        /// </summary>
        /// <returns>True if already loaded</returns>
        internal bool SchemaLoadedInModel()
        {
            var modelSchema = new XmlInstanceECSchema();
            var schemas     = modelSchema.ReadSchemas();

            return(schemas.Any(schema => schema.Equals(SchemaName, StringComparison.InvariantCultureIgnoreCase)));
        }
Exemplo n.º 2
0
        //WS: check if a specific schema exists in dgn
        internal bool SchemaLoadedInModel(string strSchemaName)
        {
            var modelSchema = new XmlInstanceECSchema();

            //WS: Get loaded scheam
            //IECSchema oSchema = modelSchema.GetLoadedSchema(strSchemaName); //WS: this got null even the schema is loaded! why??
            //Schema = modelSchema.GetLoadedSchema(strSchemaName);

            var schemas = modelSchema.ReadSchemas();

            if (schemas.Any(schema => schema.Equals(strSchemaName, StringComparison.InvariantCultureIgnoreCase)))
            {
                Schema = GetSchemaFromConnection(strSchemaName);
                return(true);
            }

            return(false);
        }