void OnSubscribe(ISubscribeEvent subscribeEvent)
        {
            ObservableState child, parent;

            _observableRepository.TryGetValue(subscribeEvent.ChildId, out child);
            _observableRepository.TryGetValue(subscribeEvent.ParentId, out parent);

            var subscriptionModel = new Subscription(subscribeEvent, child, parent)
            {
                IsActive = true
            };

            _subscriptionRepository.TryAdd(subscribeEvent.EventId, subscriptionModel);

            // hang on, this doesn't quite work, we need to
            // the values all the way up ?

            if (parent != null)
            {
                parent.Subscriptions.Add(subscriptionModel);

                parent.Children.Add(child);

                child?.Parents.Add(parent);
            }
        }
Ejemplo n.º 2
0
 public Subscription(ISubscribeEvent subscribeEvent, ObservableState child, ObservableState parent)
 {
     SubscriptionId = subscribeEvent.EventId;
     Parent         = parent;
     Child          = child;
     IsActive       = true;
     Created        = TimeSpan.FromMilliseconds(subscribeEvent.EventTime);
 }
Ejemplo n.º 3
0
 public RxSpySubscriptionModel(ISubscribeEvent subscribeEvent, RxSpyObservableModel child, RxSpyObservableModel parent)
 {
     SubscriptionId = subscribeEvent.EventId;
     Parent         = parent;
     Child          = child;
     IsActive       = true;
     Created        = TimeSpan.FromMilliseconds(subscribeEvent.EventTime);
 }
Ejemplo n.º 4
0
 public RxSpySubscriptionModel(ISubscribeEvent subscribeEvent, RxSpyObservableModel child, RxSpyObservableModel parent)
 {
     SubscriptionId = subscribeEvent.EventId;
     Parent = parent;
     Child = child;
     IsActive = true;
     Created = TimeSpan.FromMilliseconds(subscribeEvent.EventTime);
 }
Ejemplo n.º 5
0
        public void Unsubscribe(ISubscribeEvent se)
        {
            if (bookedEvents != null)
            {
                bookedEvents.Add(() => Unsubscribe(se));
                return;
            }

            for (var i = subscribeEvents.Count - 1; i >= 0; --i)
            {
                if (se == subscribeEvents[i])
                {
                    subscribeEvents.RemoveAt(i);
                }
            }
        }
Ejemplo n.º 6
0
        public void Mute(ISubscribeEvent se, bool mute = true)
        {
            if (bookedEvents != null)
            {
                bookedEvents.Add(() => Mute(se, mute));
                return;
            }

            for (var i = subscribeEvents.Count - 1; i >= 0; --i)
            {
                if (se == subscribeEvents[i])
                {
                    subscribeEvents[i].Muting = mute;
                }
            }
        }
Ejemplo n.º 7
0
        private SubscribeEventChain Subscribe(ISubscribeEvent se)
        {
            if (bookedEvents != null)
            {
                bookedEvents.Add(() => Subscribe(se));
                return(new SubscribeEventChain(this, se));
            }

            if (!registered)
            {
                registered = true;
                Deliver.Instance.Subscribe(this);
            }

            subscribeEvents.Add(se);
            return(new SubscribeEventChain(this, se));
        }
Ejemplo n.º 8
0
        void OnSubscribe(ISubscribeEvent subscribeEvent)
        {
            RxSpyObservableModel child, parent;

            observableRepository.TryGetValue(subscribeEvent.ChildId, out child);
            observableRepository.TryGetValue(subscribeEvent.ParentId, out parent);

            var subscriptionModel = new RxSpySubscriptionModel(subscribeEvent, child, parent)
            {
                IsActive = true
            };

            subscriptionRepository.TryAdd(subscribeEvent.EventId, subscriptionModel);

            parent.Subscriptions.Add(subscriptionModel);

            parent.Children.Add(child);
            child.Parents.Add(parent);
        }
Ejemplo n.º 9
0
 public void OnSubscribe(ISubscribeEvent subscribeEvent)
 {
     ForAll((h) => h.OnSubscribe(subscribeEvent));
 }
Ejemplo n.º 10
0
        void OnSubscribe(ISubscribeEvent subscribeEvent)
        {
            RxSpyObservableModel child, parent;

            observableRepository.TryGetValue(subscribeEvent.ChildId, out child);
            observableRepository.TryGetValue(subscribeEvent.ParentId, out parent);

            var subscriptionModel = new RxSpySubscriptionModel(subscribeEvent, child, parent)
            {
                IsActive = true
            };

            subscriptionRepository.TryAdd(subscribeEvent.EventId, subscriptionModel);

            parent.Subscriptions.Add(subscriptionModel);

            parent.Children.Add(child);
            child.Parents.Add(parent);
        }
Ejemplo n.º 11
0
 public static void Unsubscribe(this MonoBehaviour behaviour, ISubscribeEvent se)
 {
     GetSubscriber(behaviour).Unsubscribe(se);
 }
Ejemplo n.º 12
0
 public void OnSubscribe(ISubscribeEvent subscribeEvent)
 {
     Increment();
     _inner.OnSubscribe(subscribeEvent);
 }
Ejemplo n.º 13
0
 public void OnSubscribe(ISubscribeEvent subscribeEvent)
 {
     Increment();
     _inner.OnSubscribe(subscribeEvent);
 }
Ejemplo n.º 14
0
 public void OnSubscribe(ISubscribeEvent subscribeEvent)
 {
     EnqueueEvent(subscribeEvent);
 }
Ejemplo n.º 15
0
 public SubscribeEventChain(Subscriber subscriber, ISubscribeEvent subscribeEvent)
 {
     this.Subscriber = subscriber;
     this.Event      = subscribeEvent;
 }
Ejemplo n.º 16
0
 public void OnSubscribe(ISubscribeEvent subscribeEvent)
 {
 }
 public void OnSubscribe(ISubscribeEvent subscribeEvent)
 {
     _state.OnEvent(subscribeEvent);
 }
Ejemplo n.º 18
0
 public SubscribeEventChain(Subscriber subscriber, ISubscribeEvent subscribeEvent)
 {
     this.Subscriber = subscriber;
     this.Event = subscribeEvent;
 }
Ejemplo n.º 19
0
 public void Unmute(ISubscribeEvent se)
 {
     Mute(se, false);
 }
Ejemplo n.º 20
0
 public EventConsumer(ISubscribeEvent <TEvent> subscriber)
 {
     this.subscriber = subscriber;
 }
Ejemplo n.º 21
0
 public SubscribeEventChain(Subscriber subscriber, ISubscribeEvent subscribeEvent)
 {
     Subscriber = subscriber;
     Event      = subscribeEvent;
 }
Ejemplo n.º 22
0
 public void OnSubscribe(ISubscribeEvent subscribeEvent)
 {
     EnqueueEvent(subscribeEvent);
 }
 public void OnSubscribe(ISubscribeEvent subscribeEvent)
 {
     _eventHandler.OnSubscribe(subscribeEvent);
 }
Ejemplo n.º 24
0
 public void OnSubscribe(ISubscribeEvent subscribeEvent)
 {
     _eventHandler.OnSubscribe(subscribeEvent);
 }