示例#1
0
        private serviceType CreatePresenceService(String presList)
        {
            serviceType service = new serviceType();

            service.packages = new packagesType();

            // "sip:[email protected];pres-list=rcs
            service.uri = String.Format(CultureInfo.CurrentCulture,
                                        "{0};{1}={2}",
                                        this.xcapStack.XUI, "pres-list", presList
                                        );
            // <packages> <package>presence</package> </packages>
            service.packages.Items = new String[] { "presence" };
            // <resource-list>http://doubango.org:8080/services/resource-lists/users/sip:[email protected]/index/~~/resource-lists/list%5B@name=%22rcs%22%5D</resource-list>
            if (this.xcapDocumentsUris.ContainsKey(XcapService.XCAP_AUID_IETF_RESOURCE_LISTS_ID))
            {
                service.Item = this.xcapDocumentsUris[XcapService.XCAP_AUID_IETF_RESOURCE_LISTS_ID];
            }
            else
            {
                lock (this.xcapSelector)
                {
                    this.xcapSelector.reset();
                    this.xcapSelector.setAUID(XcapService.XCAP_AUID_IETF_RESOURCE_LISTS_ID)
                    .setAttribute("list", "name", presList);
                    service.Item = this.xcapSelector.getString();
                }
            }

            return(service);
        }
示例#2
0
        public Record(DateTime date, float mile, string type, float price, string garage)
        {
            this.Date    = date;
            this.MileAge = mile;
            this.Price   = price;
            this.Garage  = garage;
            switch (type)
            {
            case "Full":
                this.TypeOfService = serviceType.Full;

                break;

            case "Tires":
                this.TypeOfService = serviceType.Tires;
                break;

            case "Engine":
                this.TypeOfService = serviceType.Engine;
                break;

            case "Transmission":
                this.TypeOfService = serviceType.Transmission;
                break;

            default:
                break;
            }
        }
        //private void GetServices(IArcGISServerCatalog catalog, Action<IArcGISService[]> callback)
        //{
        //    Throw.IfArgumentNull(catalog, "catalog");
        //    Throw.IfArgumentNull(callback, "callback");
        //    string template = catalog.RootUrl + "/{0}/{1}";
        //    ReturnServicesToAction returnServices = new ReturnServicesToAction(ReturnServices);
        //    foreach (ArcGISServiceInfo info in catalog.ServiceInfos)
        //    {
        //        switch (info.Type)
        //        {
        //            case serviceType.FeatureServer:
        //            case serviceType.GeodataServer:
        //            case serviceType.GeometryServer:
        //                this.rest.HydrateAsync<GeometryServer>(
        //                    string.Format(template, info.Name, info.Type.ToString())+ "?" + JSON, cb =>
        //                    {
        //                        returnServices(cb, template, info, callback);
        //                    });
        //                break;
        //            case serviceType.GPServer:
        //                this.rest.HydrateAsync<GeoprocessingServer>(
        //                    string.Format(template, info.Name, info.Type.ToString()) + "?" + JSON, cb =>
        //                    {
        //                        returnServices(cb, template, info, callback);
        //                    });
        //                break;
        //            case serviceType.GeocodeServer:
        //                this.rest.HydrateAsync<GeocodeServer>(
        //                    string.Format(template, info.Name, info.Type.ToString()) + "?" + JSON, cb =>
        //                    {
        //                        returnServices(cb, template, info, callback);
        //                    });
        //                break;
        //            case serviceType.MapServer:
        //                this.rest.HydrateAsync<MapServer>(
        //                    string.Format(template, info.Name, info.Type.ToString()) + "?" + JSON, cb =>
        //                    {
        //                        returnServices(cb, template, info, callback);
        //                    });
        //                break;
        //        }

        //    }
        //}

        /// <summary>
        /// Returns the service.
        /// </summary>
        /// <param name="service">The service.</param>
        /// <param name="url">The URL.</param>
        /// <param name="type">The type.</param>
        /// <param name="version">The ArcGIS Server version.</param>
        /// <returns>
        /// Returns an instance of <see cref="IArcGISService"/>.
        /// </returns>
        private IArcGISService ReturnService(ArcGISService service, string url, serviceType type, double?version)
        {
            Throw.IfArgumentNull(service, "service");
            var token = this.ParseTokenFromUrl(url);

            url = url.Contains("?") ? url.Substring(0, url.IndexOf("?")) : url;
            if (url.EndsWith("/"))
            {
                url = url.Substring(0, url.LastIndexOf("/"));
            }
            string name = url.Substring(0, url.LastIndexOf("/"));

            name                   = name.Substring(name.LastIndexOf("/") + 1);
            service.Name           = name;
            service.RestHelper     = new RestHelper();
            service.Url            = url;
            service.CurrentVersion = version;
            service.ProxyUrl       = this.ProxyUrl;
            service.ServiceType    = type;
            service.Token          = token;
            if (type == serviceType.GPServer)
            {
                PopuplateGPTasks(service);
            }
            return((IArcGISService)service);
        }
示例#4
0
    public CustomAppHost(serviceType, serviceName, assemblies) : base(serviceName, assemblies)
    {
        List <ICustomResponseFilter> rfList = GetListOfConfiguredResponseFilters(serviceType);

        /*In GetListOfConfiguredResponseFilters method, serviceType is taken from config and it determines which site we are in currently and retrieves the configured types explained in above step for that site. We need to use reflection here.*/
        this.responseFilterActions = GetActionsListFromResponseFilters(rfList);
        /*GetActionsListFromResponseFilters method calls the GetAction method of the filters and generates a list of Action types and returns that list*/
    }
示例#5
0
        }//end PostFeatures

        #endregion
        #region Helper Methods

        private String getURI(serviceType sType)
        {
            string uri = string.Empty;

            switch (sType)
            {
            case serviceType.e_projection:
                uri = resources["projection"];
                break;
            }

            return(uri);
        }//end getURL
        }//end PostFeatures

        #endregion

        #region Helper Methods

        private String getURI(serviceType sType)
        {
            string uri = string.Empty;

            switch (sType)
            {
            case serviceType.e_projection:
                uri = ConfigurationManager.AppSettings["pointProjection"];
                break;
            }

            return(uri);
        }//end getURL
示例#7
0
        private String getURI(serviceType sType)
        {
            string uri = string.Empty;

            switch (sType)
            {
            case serviceType.e_downstream:
                uri = NLDIsettings.resources["downstreamQuery"];
                break;

            case serviceType.e_upstream:
                uri = NLDIsettings.resources["upstreamQuery"];
                break;
            }
            return(uri);
        }//end getURL
        private String getURI(serviceType sType)
        {
            string uri = string.Empty;

            switch (sType)
            {
            case serviceType.e_6hrdistribution:
                uri = settings.resources["6h_duration"];
                break;

            case serviceType.e_24hrdistribution:
                uri = settings.resources["24h_duration"];
                break;
            }

            return(uri);
        }//end getURL
示例#9
0
 var(serviceType, configure) = part;
 => _transformationServiceContainer !.AddService(serviceType, serviceInstance);