public void Unsubscribe(Observable <T> observable)
 {
     //lock (SyncObject)
     //{
     if (observable == null)
     {
         return;
     }
     try
     {
         Unsubscriber <T> target = null;
         if (m_DictObservables.TryGetValue(observable, out target))
         {
             m_DictObservables.Remove(observable);
             if (target != null)
             {
                 target.Dispose();
             }
         }
         if (m_DictObservables.Count == 0)
         {
             MessageQueue.Quit();
             MessageQueue.Clear();
         }
     }
     catch (Exception e)
     {
         e.LogError();
     }
     //}
 }
 public void Unsubscribe(IObservable <T> observable)
 {
     if (!IsDisposed && m_Unsubscriber != null && !m_Unsubscriber.IsDisposed)
     {
         m_Unsubscriber.Dispose();
         //m_Unsubscriber = null;
         MessageQueue.Quit();
         MessageQueue.Clear();
     }
 }
Exemple #3
0
 public void ScanToQueue(int qsize = 1024)
 {
     Queue         = new BlockingQueue <string> (qsize);
     AddFileAction = AddFileToQueue;
     Scan();
     Queue.Quit();
 }