示例#1
0
        public static AgsHost LoadFrom(string fileName)
        {
            BinaryFormatter formatter  = new BinaryFormatter();
            FileStream      fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read);
            AgsHost         agsHost    = formatter.Deserialize(fileStream) as AgsHost;

            fileStream.Dispose();
            return(agsHost);
        }
示例#2
0
        public AgsGeocodeService(AgsHost host, string service)
        {
            _serviceDescription = host.ServiceDescriptions.FirstOrDefault(sd => sd.Type == "GeocodeServer" && String.Compare(sd.Name, service, true) == 0);

            if (_serviceDescription == null)
            {
                throw new AgsException(String.Format("The geocode service \"{0}\" does not exist on the ArcGIS Server", service));
            }

            Host = host;
            Name = _serviceDescription.Name;

            Reload();
        }
示例#3
0
        public AgsGeoDataService(AgsHost host, string service)
        {
            ServiceDescription serviceDescription = host.ServiceDescriptions.FirstOrDefault(sd => sd.Type == "GeoDataServer" && String.Compare(sd.Name, service, true) == 0);

            if (serviceDescription == null)
            {
                throw new AgsException(String.Format("The geodata service \"{0}\" does not exist on the ArcGIS Server", service));
            }

            Host = host;
            Name = serviceDescription.Name;

            _geoDataServer                 = serviceDescription.GetService() as GeoDataServer;
            _geoDataServer.Credentials     = host.Credentials;
            _geoDataServer.PreAuthenticate = _geoDataServer.Credentials != null;

            Reload();
        }