Пример #1
0
 /// <summary>
 /// Attempt to reconnect to the server. Called when connection has closed.
 /// </summary>
 public void Reconnect()
 {
     if (_reconnecting)
     {
         return;
     }
     try
     {
         _reconnecting = true;
         Connect();
     }
     catch (Exception ex)
     {
         Common.LogError(ex);
         Notifications.ChangeTrayText(MessageType.Disconnected);
         ReconnectingFailed.SafeInvoke(null, EventArgs.Empty);
     }
     finally
     {
         _reconnecting = false;
     }
 }
Пример #2
0
 /// <summary>
 ///     Attempt to reconnect to the server. Called when connection has closed.
 /// </summary>
 public async Task Reconnect()
 {
     if (_reconnecting)
     {
         return;
     }
     try
     {
         _reconnecting = true;
         await Connect();
     }
     catch (Exception ex)
     {
         ex.LogException();
         Notifications.ChangeTrayText(MessageType.Disconnected);
         ReconnectingFailed.SafeInvoke(null, EventArgs.Empty);
     }
     finally
     {
         _reconnecting = false;
     }
 }