Пример #1
0
        /// <summary>
        /// Causes the ConnectionManagerStateChangedEvent to be broadcast
        /// </summary>
        /// <param name="oldState">Previous state of the connection</param>
        /// <param name="newState">New state of the connection</param>
        private void BroadcastStateChangedEvent(ConnectionState oldState, ConnectionState newState)
        {
            ConnectionStateChangedEventArgs connectionStateChangedEventArgs =
                new ConnectionStateChangedEventArgs(oldState, newState);

            this.connectionManager.RaiseConnectionStateChangedEvent(connectionStateChangedEventArgs);
        }
Пример #2
0
		/// <summary>
		/// Causes the ConnectionManagerStateChangedEvent to be broadcast
		/// </summary>
		/// <param name="oldState">Previous state of the connection</param>
		/// <param name="newState">New state of the connection</param>
		private void BroadcastStateChangedEvent(ConnectionState oldState, ConnectionState newState)
		{
			ConnectionStateChangedEventArgs connectionStateChangedEventArgs = 
				new ConnectionStateChangedEventArgs(oldState, newState);
			this.connectionManager.RaiseConnectionStateChangedEvent(connectionStateChangedEventArgs);
		}
Пример #3
0
		internal void RaiseConnectionStateChangedEvent(ConnectionStateChangedEventArgs e)
		{
			EventHelper.BroadcastEvent(ConnectionStateChanged, this, e);
		}
Пример #4
0
        /// <summary>
        /// Called when [connection state changed].
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="ConnectionStateChangedEventArgs"/> instance containing the event data.</param>
        public void OnConnectionStateChanged(object sender, ConnectionStateChangedEventArgs e)
        {
            online = e.CurrentState == Uniframework.Client.ConnectionState.Online;
            if (e.CurrentState == Uniframework.Client.ConnectionState.Online)
            {
                this.Invoke(new EventHandler(delegate
                {
                    tbtnNetworkStatus.Glyph = Resources.link;
                    tbtnNetworkStatus.Hint = "��ǰ״̬ - ���ߣ�˫�����ǿ��ϵͳ���ߣ�";
                }));

                // ����ע���¼�����ֹ�����������ʧ�ҽӵĿͻ����¼�
                ClientEventDispatcher.Instance.RereregisterAllEvent();
            }
            else
            {
                this.Invoke(new EventHandler(delegate
                {
                    tbtnNetworkStatus.Glyph = Resources.link_delete;
                    tbtnNetworkStatus.Hint = "��ǰ״̬ - ���ߣ�˫�����ǿ��ϵͳ���ߣ�";
                }));
            }
            if (ConnectionStateChanged != null && (e.CurrentState != e.OriginalState))
                ConnectionStateChanged(e.CurrentState);
        }
Пример #5
0
        private void OnConnectionDispatch(object sender, ConnectionStateChangedEventArgs e)
        {
            if (thread != null)
            {
                //Stop current dispatching
                thread.Stop();
                thread.Join(25000);
            }

            if (e.CurrentState == ConnectionState.Online)
            {
                DispatchAllPendingRequests();
            }
        }
Пример #6
0
 internal void RaiseConnectionStateChangedEvent(ConnectionStateChangedEventArgs e)
 {
     EventHelper.BroadcastEvent(ConnectionStateChanged, this, e);
 }