예제 #1
0
 public virtual bool IsRegistered <T>()
     where T : Presenter
 {
     return(EH.Any(
                EH.OfType <T>(
                    this.presenters)));
 }
예제 #2
0
        public override void PresentFluidly <T>(
            string name)
        {
            NamedPresenter np;

            lock (this.locker)
            {
                var matchingPresenters = EH.OfType <T>(
                    this.presenters);
                foreach (var presenter in matchingPresenters)
                {
                    if (presenter.Name != name)
                    {
                        continue;
                    }

                    np = presenter;
                    goto start;
                }
            }

            return;

start:
            this.startPresenter?.Invoke(np);
        }
예제 #3
0
 public override bool IsRegistered <T>()
 {
     lock (this.locker)
     {
         return(EH.Any(
                    EH.OfType <T>(
                        this.presenters)));
     }
 }
예제 #4
0
 public virtual bool IsRegistered <T>(
     string name)
     where T : NamedPresenter
 {
     return(EH.Any(
                EH.OfType <T>(
                    this.presenters),
                p => p.Name == name));
 }
예제 #5
0
 public virtual void StopPresenter <T>()
     where T : Presenter
 {
     foreach (var presenter in EH.OfType <T>(
                  this.presenters))
     {
         presenter?.Stop();
         break;
     }
 }
예제 #6
0
 public override bool IsRegistered <T>(
     string name)
 {
     lock (this.locker)
     {
         return(EH.Any(
                    EH.OfType <T>(
                        this.presenters),
                    p => p.Name == name));
     }
 }
예제 #7
0
 public override void StopPresenter <T>()
 {
     lock (this.locker)
     {
         foreach (var presenter in EH.OfType <T>(
                      this.presenters))
         {
             presenter.Stop();
             break;
         }
     }
 }
예제 #8
0
 public virtual void StopPresenter <T>(
     string name)
     where T : NamedPresenter
 {
     foreach (var presenter in
              EH.Where(
                  EH.OfType <T>(
                      this.presenters),
                  p => p.Name == name))
     {
         presenter?.Stop();
         break;
     }
 }
예제 #9
0
 public override void StopPresenter <T>(
     string name)
 {
     lock (this.locker)
     {
         foreach (var presenter in
                  EH.Where(
                      EH.OfType <T>(
                          this.presenters),
                      p => p.Name == name))
         {
             presenter.Stop();
             break;
         }
     }
 }
예제 #10
0
        public virtual bool Unregister <T>()
            where T : Presenter
        {
            var  ps           = this.presenters;
            bool unregistered = falsity;

            lock (this.locker)
            {
                foreach (var p in EH.OfType <T>(ps))
                {
                    unregistered = ps.Remove(p);
                    break;
                }
            }

            return(unregistered);
        }
예제 #11
0
        public virtual void PresentFluidly <T>(
            string name)
            where T : NamedPresenter
        {
            var matchingPresenters = EH.OfType <T>(
                this.presenters);

            foreach (var presenter in matchingPresenters)
            {
                if (presenter.Name != name)
                {
                    continue;
                }

                this.startPresenter?.Invoke(presenter);
                break;
            }
        }
예제 #12
0
        public virtual bool Unregister <T>(
            string name)
            where T : NamedPresenter
        {
            var  ps           = this.presenters;
            bool unregistered = falsity;

            lock (this.locker)
            {
                foreach (var p in EH.OfType <T>(ps))
                {
                    if (p.Name != name)
                    {
                        continue;
                    }

                    unregistered = ps.Remove(p);
                    break;
                }
            }

            return(unregistered);
        }
예제 #13
0
        public virtual void Present <T>(
            string name)
            where T : NamedPresenter
        {
            var ps = this.presenters;
            var matchingPresenters = EH.OfType <T>(ps);

            foreach (var presenter in matchingPresenters)
            {
                if (presenter.Name != name)
                {
                    continue;
                }

                foreach (var p in ps)
                {
                    p?.Stop();
                }

                this.startPresenter?.Invoke(presenter);
                break;
            }
        }