Пример #1
0
        void IConnection.PrepareRequest(IRequest request)
        {
#if WINDOWS_PHONE
            // http://msdn.microsoft.com/en-us/library/ff637320(VS.95).aspx
            request.UserAgent = CreateUserAgentString("SignalR.Client.WP7");
#else
#if SILVERLIGHT
            // Useragent is not possible to set with Silverlight, not on the UserAgent property of the request nor in the Headers key/value in the request
#else
            request.UserAgent = CreateUserAgentString("SignalR.Client");
#endif
#endif
            if (Credentials != null)
            {
                request.Credentials = Credentials;
            }

            if (CookieContainer != null)
            {
                request.CookieContainer = CookieContainer;
            }

#if !SILVERLIGHT
            if (Proxy != null)
            {
                request.Proxy = Proxy;
            }
#endif
            request.SetRequestHeaders(Headers);

#if (NET4 || NET45)
            request.AddClientCerts(certCollection);
#endif
        }
Пример #2
0
        void IConnection.PrepareRequest(IRequest request)
        {
            #if WINDOWS_PHONE
            // http://msdn.microsoft.com/en-us/library/ff637320(VS.95).aspx
            request.UserAgent = CreateUserAgentString("SignalR.Client.WP7");
            #else
            #if SILVERLIGHT
            // Useragent is not possible to set with Silverlight, not on the UserAgent property of the request nor in the Headers key/value in the request
            #else
            request.UserAgent = CreateUserAgentString("SignalR.Client");
            #endif
            #endif
            if (Credentials != null)
            {
                request.Credentials = Credentials;
            }

            if (CookieContainer != null)
            {
                request.CookieContainer = CookieContainer;
            }

            #if !SILVERLIGHT
            if (Proxy != null)
            {
                request.Proxy = Proxy;
            }
            #endif
            request.SetRequestHeaders(Headers);

            #if (NET4 || NET45)
            request.AddClientCerts(certCollection);
            #endif
        }