Exemplo n.º 1
0
        private const int Port           = 44306; //localhost port for the web service

        private static Uri APIMapper(APIType api)
        {
            var uBuilder = new UriBuilder();

            uBuilder.Scheme = Scheme;
            uBuilder.Host   = Host;
            if (UsePortNumber)
            {
                uBuilder.Port = Port;
            }

            uBuilder.Path = "api/" + api.Description();
            return(uBuilder.Uri);
        }
Exemplo n.º 2
0
        private static Uri APIMapper(APIType api)
        {
            var uBuilder = new UriBuilder();

            uBuilder.Scheme = GlobalVariables.Scheme;
            uBuilder.Host   = GlobalVariables.Host;
            if (GlobalVariables.UsePortNumber)
            {
                uBuilder.Port = GlobalVariables.Port;
            }

            var sBuilder = new StringBuilder();

            if (!string.IsNullOrWhiteSpace(GlobalVariables.AppPath))
            {
                sBuilder.AppendFormat("{0}/", GlobalVariables.AppPath);
            }
            sBuilder.AppendFormat("api/{0}/", api.Description());

            uBuilder.Path = sBuilder.ToString();
            return(uBuilder.Uri);
        }