示例#1
0
        public UhandledExceptionHandler(IClientLogger logger)
        {
            _logger = logger;

            Application.Current.DispatcherUnhandledException += CurrentDispatcherUnhandledException;
            AppDomain.CurrentDomain.UnhandledException       += CurrentDomainUnhandledException;
        }
 public ConnectionOptions(string uri, IClientLogger logger = null)
 {
     Uri = uri;
     TransportConnectTimeout   = 60;
     TimeoutWaitingForResponse = 60;
     Logger = logger;
 }
 public IssPlusWebSocketClient(IClientLogger logger)
 {
     _logger        = logger;
     Connected      = false;
     _subscriptions = new ConcurrentDictionary <string, Subscription>();
     _ser           = new StompMessageSerializer();
     _buffer        = new ArraySegment <byte>(new byte[1024 * 64]);
 }
示例#4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="QuarrelClient"/> class.
        /// </summary>
        public QuarrelClient(IClientLogger logger)
        {
            Logger = logger;

            Channels = new QuarrelClientChannels(this);
            Guilds   = new QuarrelClientGuilds(this);
            Members  = new QuarrelClientMembers(this);
            Messages = new QuarrelClientMessages(this);
            Self     = new QuarrelClientSelf(this);
            Users    = new QuarrelClientUsers(this);
            Voice    = new QuarrelClientVoice(this);
        }
示例#5
0
        /// <summary>
        /// Create a new web channel to the specified host.
        /// </summary>
        public WebChannel(IClientLogger logger, bool useSsl, string hostName, int port, string applicationBaseDirectory, Version appProtocolVersion)
        {
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            if (hostName != null)
            {
                m_HostName = hostName.Trim();
            }

            if (string.IsNullOrEmpty(hostName))
            {
                throw new ArgumentNullException(nameof(hostName), "A server name must be provided for a connection");
            }

            m_Logger = logger;
            m_UseSsl = useSsl;
            m_Port   = port;
            m_ApplicationBaseDirectory = applicationBaseDirectory;
            AppProtocolVersion         = appProtocolVersion;

            //format up base directory in case we get something we can't use.  It has to have leading & trailing slashes.
            if (string.IsNullOrEmpty(m_ApplicationBaseDirectory) == false)
            {
                m_ApplicationBaseDirectory = m_ApplicationBaseDirectory.Trim();
                if (m_ApplicationBaseDirectory.StartsWith("/") == false)
                {
                    m_ApplicationBaseDirectory = "/" + m_ApplicationBaseDirectory;
                }

                if (m_ApplicationBaseDirectory.EndsWith("/") == false)
                {
                    m_ApplicationBaseDirectory = m_ApplicationBaseDirectory + "/";
                }
            }

            m_CancellationTokenSource = new CancellationTokenSource();
        }
示例#6
0
 /// <summary>
 /// Create a new web channel to the specified host.
 /// </summary>
 public WebChannel(IClientLogger logger, bool useSsl, string hostName, string applicationBaseDirectory, Version appProtocolVersion)
     : this(logger, useSsl, hostName, useSsl ? 443 : 80, applicationBaseDirectory, appProtocolVersion)
 {
 }
示例#7
0
 /// <summary>
 /// Create a new web channel to the specified host.
 /// </summary>
 public WebChannel(IClientLogger logger, string hostName)
     : this(logger, false, hostName, null, null)
 {
 }
示例#8
0
 public HttpClientLogger(IClientLogger logger, HttpClientHandler innerHandler)
     : base(innerHandler)
 {
     m_Logger = logger;
 }
示例#9
0
 static ICanLogEx()
 {
     _logger = AppCore.Instance.Get <IClientLogger>();
 }
 public static void LogAndThrow(this IClientLogger logger, Exception exception)
 {
     logger.LogError(exception.Message);
     throw exception;
 }