Esempio n. 1
0
 internal GeoRestConnection(string url, string configFile)
 {
     _geoRestUrl = url;
     _configFile = configFile;
     _conf = GeoRestFeatureSourceConfiguration.LoadFrom(configFile);
 }
Esempio n. 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;
        }