void nsIObserver.Observe(nsISupports aSubject, string aTopic, string aData)
 {
     if (aTopic != ObserverNotifications.HttpRequests.HttpOnModifyRequest)
     {
         return;
     }
     using (var channel = HttpChannel.Create(aSubject))
     {
         ObserveRequest(channel);
     }
 }
Ejemplo n.º 2
0
        void nsIObserver.Observe(nsISupports aSubject, string aTopic, string aData)
        {
            switch (aTopic)
            {
            case ObserverNotifications.HttpRequests.HttpOnModifyRequest:
                using (var req = HttpChannel.Create(aSubject))
                {
                    // error handling will help in debug
#if DEBUG
                    try
                    {
                        Request(req);
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Exception in observer implementation");
                    }
#else
                    Request(req);
#endif
                }
                break;

            case ObserverNotifications.HttpRequests.HttpOnExamineResponse:
                using (var res = HttpChannel.Create(aSubject))
                {
                    // error handling will help in debug
#if DEBUG
                    try
                    {
                        Response(res);
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Exception in observer implementation");
                    }
#else
                    Response(res);
#endif
                }
                break;
            }
        }
Ejemplo n.º 3
0
        void nsIObserver.Observe(nsISupports aSubject, string aTopic, string aData)
        {
            switch (aTopic)
            {
            case ObserverNotifications.HttpRequests.HttpOnModifyRequest:
                using (var req = HttpChannel.Create(aSubject))
                {
                    Request(req);
                }
                break;

            case ObserverNotifications.HttpRequests.HttpOnExamineResponse:
                using (var res = HttpChannel.Create(aSubject))
                {
                    Response(res);
                }
                break;
            }
        }
Ejemplo n.º 4
0
 public static IChannel Create(string endpoint, X509Certificate2 certificate, IEnumerable <Observer> observers,
                               CancellationToken token = default)
 {
     return(HttpChannel.Create(endpoint, certificate, observers, token));
 }
Ejemplo n.º 5
0
 public static IChannel Create(string endpoint, string securityToken, IEnumerable <Observer> observers,
                               CancellationToken token = default)
 {
     return(HttpChannel.Create(endpoint, securityToken, observers, token));
 }
Ejemplo n.º 6
0
 public static IChannel Create(string endpoint, X509Certificate2 certficate)
 {
     return(HttpChannel.Create(endpoint, certficate));
 }
Ejemplo n.º 7
0
 public static IChannel Create(string endpoint, string securityToken)
 {
     return(HttpChannel.Create(endpoint, securityToken));
 }
Ejemplo n.º 8
0
 public static IChannel Create(string endpoint, string resourceUriString, string contentType,
                               string securityToken)
 {
     return(HttpChannel.Create(endpoint, resourceUriString, contentType, securityToken));
 }
Ejemplo n.º 9
0
 public static IChannel Create(HttpContext context)
 {
     return(HttpChannel.Create(context));
 }
Ejemplo n.º 10
0
 /// <summary>
 /// HTTP server channel used to receive messages
 /// </summary>
 /// <param name="request"></param>
 /// <returns></returns>
 //public static IChannel Create(HttpRequestMessage request)
 public static IChannel Create(HttpContext context)
 {
     return(HttpChannel.Create(context));
     //return HttpChannel.Create(request);
 }