Beispiel #1
0
        public static GenEntityConfigTypes.EntityConfig Load(string file)
        {
            XmlValidator validator = new XmlValidator(file, new List <string> {
                Properties.Resources.EntityConfigSchema
            });

            if (!validator.isValid())
            {
                MessageBox.Show(validator.ValidationResult);
                return(null);
            }

            object info = validator.GetConfigurationInfo(typeof(GenEntityConfigTypes.EntityConfig));

            GenEntityConfigTypes.EntityConfig ec = null;
            if (info is GenEntityConfigTypes.EntityConfig)
            {
                ec = info as GenEntityConfigTypes.EntityConfig;
                return(ec);
            }
            return(null);
        }