Beispiel #1
0
 private void PutConfig(string featureSource, string featureClass, GeoRestFeatureSource fs)
 {
     _configuredFeatureSources[featureSource + "|" + featureClass] = fs;
 }
Beispiel #2
0
        internal static GeoRestFeatureSourceConfiguration LoadFrom(string configFile)
        {
            var conf = new GeoRestFeatureSourceConfiguration();

            if (!string.IsNullOrEmpty(configFile) && File.Exists(configFile))
            {
                XmlDocument doc = new XmlDocument();
                doc.Load(configFile);

                XmlNodeList fsNodes = doc.GetElementsByTagName("GeoRestFeatureSource");
                foreach (XmlNode fsNode in fsNodes)
                {
                    var gfs = new GeoRestFeatureSource()
                    {
                        FeatureSourceId = fsNode["FeatureSource"].InnerText,
                        FeatureClass = fsNode["FeatureClass"].InnerText,
                        UriPart = fsNode["UriPart"].InnerText,
                        AllowInsert = bool.Parse(fsNode["AllowInsert"].InnerText),
                        AllowUpdate = bool.Parse(fsNode["AllowUpdate"].InnerText),
                        AllowDelete = bool.Parse(fsNode["AllowDelete"].InnerText)
                    };

                    conf.PutConfig(gfs.FeatureSourceId, gfs.FeatureClass, gfs);
                }
            }

            return conf;
        }