コード例 #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();
            }
        }
コード例 #2
0
ファイル: EventClient.cs プロジェクト: ashsvis/L2M
 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);
 }
コード例 #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);
     }
 }
コード例 #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;
             }
         }
     }
 }
コード例 #5
0
 public ClientConnectionChangedEventArgs(ClientConnectionStatus status, IDataServiceClient client)
 {
     Status = status;
     Client = client;
 }
コード例 #6
0
ファイル: ProgramService.cs プロジェクト: ashsvis/L2M
 static void UpdateLocalConnectionStatus(Guid clientId, ClientConnectionStatus status)
 {
     if (status == ClientConnectionStatus.Opened)
     {
     }
 }
コード例 #7
0
		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
			} );

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