public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = EndPoints.FirstOrDefault()?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (Error != null ? Error.Message.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsQueryDefined.GetHashCode();
         hashCode = (hashCode * 397) ^ (ActiveVersion != null ? ActiveVersion.GetHashCode() : 0);
         return(hashCode);
     }
 }
示例#2
0
            private static void HandleRequest(HttpListenerContext c)
            {
                Logger.Log(LogLevel.Verbose, "debugrc", $"Requested: {c.Request.RawUrl}");

                string url          = c.Request.RawUrl;
                int    indexOfSplit = url.IndexOf('?');

                if (indexOfSplit != -1)
                {
                    url = url.Substring(0, indexOfSplit);
                }

                RCEndPoint endpoint =
                    EndPoints.FirstOrDefault(ep => ep.Path == c.Request.RawUrl) ??
                    EndPoints.FirstOrDefault(ep => ep.Path == url) ??
                    EndPoints.FirstOrDefault(ep => ep.Path.ToLowerInvariant() == c.Request.RawUrl.ToLowerInvariant()) ??
                    EndPoints.FirstOrDefault(ep => ep.Path.ToLowerInvariant() == url.ToLowerInvariant()) ??
                    EndPoints.FirstOrDefault(ep => ep.Path == "/404");

                endpoint.Handle(c);
            }
示例#3
0
 /// <summary>
 ///     Gets the end point.
 /// </summary>
 /// <param name="id">The identifier.</param>
 /// <returns></returns>
 public VideoEndpoint GetEndPoint(int id)
 {
     return(EndPoints.FirstOrDefault(c => c.Id == id));
 }