Exemplo n.º 1
0
 public void SetEnabled(bool enabled)
 {
     _mutex.Lock();
     try
     {
         if (_enabled == enabled)
         {
             return;
         }
         if (enabled)
         {
             _enabled     = true;
             _discardLogs = false;
             _stateKeeper.InvalidateState();
             CheckPendingLogs();
         }
         else
         {
             Suspend(true, new CancellationException());
         }
     }
     finally
     {
         _mutex.Unlock();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Method that is called to signal start of the Push service.
 /// </summary>
 /// <param name="channelGroup"></param>
 /// <param name="appSecret"></param>
 public override void OnChannelGroupReady(IChannelGroup channelGroup, string appSecret)
 {
     _mutex.Lock();
     try
     {
         base.OnChannelGroupReady(channelGroup, appSecret);
         ApplyEnabledState(Enabled);
     }
     finally
     {
         _mutex.Unlock();
     }
 }