Esempio n. 1
0
        public void Unregister(BaseInformer informer)
        {
            if (!_items.Remove(informer))
            {
                return;
            }

            Stop(informer);
            informer.Changed -= InformerOnChanged;
        }
Esempio n. 2
0
        public void Register(BaseInformer informer)
        {
            if (informer == null)
            {
                throw new ArgumentNullException(nameof(informer));
            }
            if (_items.Any(x => string.Equals(x.Name, informer.Name, StringComparison.InvariantCultureIgnoreCase)))
            {
                throw new ArgumentException("Informer with same name already registered.", nameof(informer));
            }

            _items.Add(informer);
            informer.Changed += InformerOnChanged;
            if (Started)
            {
                Start(informer);
            }
            else
            {
                Stop(informer);
            }
        }
Esempio n. 3
0
 private void Stop(BaseInformer informer)
 {
     informer.Stop();
 }
Esempio n. 4
0
 private void Start(BaseInformer informer)
 {
     informer.Start();
 }