Ejemplo n.º 1
0
 void ServerNetworkStateChanged(INetworkStateChangedEventArgs args, IServer server)
 {
     if (args.State == ConnectionNetworkState.Connected)
     {
         LoadSettings();
     }
     if (args.State == ConnectionNetworkState.Disconnected)
     {
         LoadSettings();
     }
 }
 private void OnServerOnNetworkStateChanged(INetworkStateChangedEventArgs args, IServer server1)
 {
     if (args.State != ConnectionNetworkState.Connecting && args.State != ConnectionNetworkState.Connected && !server1.IsConnected)
     {
         if (SelectedConnection.EnvironmentID == server1.EnvironmentID)
         {
             if (!IsConnecting && server1.EnvironmentID == Guid.Empty)
             {
                 ServerHasDisconnected(this, server1);
             }
             IsConnected = false;
             ServerDisconnected?.Invoke(this, SelectedConnection);
             PopupController?.Show(ErrorResource.ServerconnectionDropped + Environment.NewLine + ErrorResource.EnsureConnectionToServerWorking
                                   , ErrorResource.ServerDroppedErrorHeading, MessageBoxButton.OK, MessageBoxImage.Information, "", false, false, true, false, false, false);
         }
     }
     else
     {
         if (args.State == ConnectionNetworkState.Connected)
         {
             ServerReConnected?.Invoke(this, server1);
         }
     }
 }