コード例 #1
0
        public UserizyonClient(IULibBindings bindings)
        {
            _tdJsonClient = new UJsonClient(bindings);

            _tasks = new ConcurrentDictionary <int, Action <UApi.Object> >();

            _receiver           = new Receiver(_tdJsonClient);
            _receiver.Received += OnReceived;
            _receiver.AuthorizationStateChanged += OnAuthorizationStateChanged;
            _receiver.Start();
        }
コード例 #2
0
        /// <summary>
        /// Disposes client and json client
        /// Updates are stopped from being sent to updates handler
        /// </summary>
        public void Dispose()
        {
            lock (_disposeLock)
            {
                if (_receiver == null || _tdJsonClient == null)
                {
                    return;
                }

                CloseSynchronously();

                _receiver.Dispose();
                _receiver.Received -= OnReceived;
                _receiver.AuthorizationStateChanged -= OnAuthorizationStateChanged;
                _receiver = null;

                _tdJsonClient.Dispose();
                _tdJsonClient = null;
            }
        }