Example #1
0
 private void AddUpdateWorker(TweetWorker w, AccountInfo fallbackOriginal)
 {
     if (fallbackOriginal == null)
     {
         fallbackOriginal = w.AccountInfo;
     }
     else if (fallbackOriginal == w.AccountInfo)
     {
         ExceptionStorage.Register(new InvalidOperationException("フォールバックがループしています。"), ExceptionCategory.ConfigurationError);
         return;
     }
     DispatcherHelper.BeginInvoke(() => this._updateWorkers.Add(w));
     w.fallbackOriginalAccount = fallbackOriginal;
     w.RemoveRequired         += () => DispatcherHelper.BeginInvoke(() => this._updateWorkers.Remove(w));
     w.FallbackRequired       += new Action <TweetWorker>(fw => AddUpdateWorker(fw, fallbackOriginal));
     w.DoWork().ContinueWith(t =>
     {
         if (t.Result)
         {
             Thread.Sleep(Setting.Instance.ExperienceProperty.PostFinishShowLength);
             DispatcherHelper.BeginInvoke(() => this._updateWorkers.Remove(w));
         }
     });
 }
Example #2
0
 public void AddUpdateWorker(TweetWorker w)
 {
     AddUpdateWorker(w, null);
 }
Example #3
0
 private void AddUpdateWorker(TweetWorker w, AccountInfo fallbackOriginal)
 {
     if (fallbackOriginal == null)
     {
         fallbackOriginal = w.AccountInfo;
     }
     else if (fallbackOriginal == w.AccountInfo)
     {
         ExceptionStorage.Register(new InvalidOperationException("フォールバックがループしています。"), ExceptionCategory.ConfigurationError);
         return;
     }
     DispatcherHelper.BeginInvoke(() => this._updateWorkers.Add(w));
     w.fallbackOriginalAccount = fallbackOriginal;
     w.RemoveRequired += () => DispatcherHelper.BeginInvoke(() => this._updateWorkers.Remove(w));
     w.FallbackRequired += new Action<TweetWorker>(fw => AddUpdateWorker(fw, fallbackOriginal));
     w.DoWork().ContinueWith(t =>
     {
         if (t.Result)
         {
             Thread.Sleep(Setting.Instance.ExperienceProperty.PostFinishShowLength);
             DispatcherHelper.BeginInvoke(() => this._updateWorkers.Remove(w));
         }
     });
 }
Example #4
0
 public void AddUpdateWorker(TweetWorker w)
 {
     DispatcherHelper.BeginInvoke(() => this._updateWorkers.Add(w));
     w.RemoveRequired += () => DispatcherHelper.BeginInvoke(() => this._updateWorkers.Remove(w));
     w.WorkerAddRequired += AddUpdateWorker;
     w.DoWork().ContinueWith(t =>
     {
         if (t.Result)
         {
             Thread.Sleep(Setting.Instance.ExperienceProperty.PostFinishShowLength);
             DispatcherHelper.BeginInvoke(() => this._updateWorkers.Remove(w));
         }
     });
 }
Example #5
0
 public void AddUpdateWorker(TweetWorker w)
 {
     AddUpdateWorker(w, null);
 }