ClearCanvas.ImageServer.Services.Streaming.Shreds.UriHelper.GetServerAE C# (CSharp) Метод

GetServerAE() публичный статический Метод

public static GetServerAE ( HttpListenerContext context ) : string
context System.Net.HttpListenerContext
Результат string
        public static string GetServerAE(HttpListenerContext context)
        {
            string[] requestSegments = context.Request.Url.Segments;
            if (requestSegments.Length <= SegmentCount)
                return String.Empty;

            return requestSegments[SegmentCount];
        }
    }

Usage Example

Пример #1
0
        private static void Validate(HttpListenerContext context)
        {
            string serverAE = UriHelper.GetServerAE(context);

            if (String.IsNullOrEmpty(serverAE))
            {
                throw new HttpException((int)HttpStatusCode.BadRequest,
                                        String.Format("Partition AE Title is required after {0}", ImageStreamingServerSettings.Default.Path));
            }


            ServerPartition partition = ServerPartitionMonitor.Instance.GetPartition(serverAE);

            if (partition == null)
            {
                throw new HttpException((int)HttpStatusCode.BadRequest, String.Format("Partition AE {0} is invalid", serverAE));
            }

            string requestType = context.Request.QueryString["requestType"] ?? "";

            if (String.IsNullOrEmpty(requestType))
            {
                throw new WADOException(HttpStatusCode.BadRequest, "RequestType parameter is missing");
            }
        }