Beispiel #1
0
        private void UpdateLocalConnectionStatus(Guid clientId, ClientConnectionStatus status)
        {
            var method = new MethodInvoker(() =>
            {
                switch (status)
                {
                case ClientConnectionStatus.Opened:
                    Text = "Подключение к серверу событий установлено.";
                    break;

                case ClientConnectionStatus.Opening:
                    Text = "Подключение к серверу событий...";
                    //config.Clear();
                    //fetching.Clear();
                    break;

                default:
                    break;
                }
            });

            if (InvokeRequired)
            {
                BeginInvoke(method);
            }
            else
            {
                method();
            }
        }
Beispiel #2
0
 private void ConnectionStatus(Guid clientId, ClientConnectionStatus status)
 {
     if (status == ClientConnectionStatus.Faulted)
     {
         if (_showError != null)
         {
             var mess = "Канал связи перешёл в состояние \"Ошибка\"";
             _showError(mess);
         }
         _faultTimer.Enabled = true;
     }
     _connectionStatus?.Invoke(clientId, status);
 }
Beispiel #3
0
 private void ConnectionStatus(Guid clientId, string ipaddr, ClientConnectionStatus status)
 {
     if (status == ClientConnectionStatus.Faulted)
     {
         if (_showError != null)
         {
             var mess = "Канал связи [" + ipaddr + "] перешёл в состояние \"Ошибка\"";
             _showError(mess);
         }
         _faultTimer.Enabled = true;
     }
     if (_connectionStatus != null)
     {
         _connectionStatus(clientId, ipaddr, status);
     }
 }
Beispiel #4
0
 private static void UpdateConnectionStatus(Guid clientId, string ipaddr, ClientConnectionStatus status)
 {
     lock (Data.StationNodes)
     {
         foreach (var stationNode in Data.StationNodes)
         {
             if (stationNode.Enable && !stationNode.ItThisStation && stationNode.ClientId == clientId)
             {
                 stationNode.Actived          = true;
                 stationNode.ConnectionStatus = status;
             }
             else
             {
                 stationNode.Actived = false;
             }
         }
     }
 }
Beispiel #5
0
 public ClientConnectionChangedEventArgs(ClientConnectionStatus status, IDataServiceClient client)
 {
     Status = status;
     Client = client;
 }
Beispiel #6
0
 static void UpdateLocalConnectionStatus(Guid clientId, ClientConnectionStatus status)
 {
     if (status == ClientConnectionStatus.Opened)
     {
     }
 }
		private void IndicateConnectionState( ClientConnectionStatus newState ) {

			if( newState == ClientConnectionStatus.Disconnected && AutoReconnect ) {
				AttemptReconnectIfAppropriate();
			}

			if( ConnectionStatus == newState )
				return;

			var previousState = ConnectionStatus;
			ConnectionStatus = newState;

			OnSteamChatClientConnectionChange( new SteamChatConnectionChangeEventArgs {
				ChangeDateTime = DateTime.UtcNow,
				PreviousConnectionState = previousState,
				NewConnectionState = ConnectionStatus
			} );

		}
Beispiel #8
0
 protected virtual void OnStateChanged(StateChangedEventArgs e)
 {
     _status = e.NextState;
     StateChanged?.Invoke(this, e);
 }
 protected void SetStatus(ClientConnectionStatus status)
 {
     Logger.WriteDebug($"Authentication client status changing to: {status}");
     _status.OnNext(status);
 }