Example #1
0
        private void RegisterTargetTriggerEventHandler()
        {
            this.UnregisterTargetTriggerEventHandler();

            var t = this.Trigger;

            if (t == null)
            {
                return;
            }

            _targetTrigger = null;
            var arr = t.GetEvents();

            if (arr.Length == 1)
            {
                _targetTrigger = arr[0];
            }
            else
            {
                for (int i = 0; i < arr.Length; i++)
                {
                    if (arr[i].ObservableTriggerId == _triggerId)
                    {
                        _targetTrigger = arr[i];
                        break;
                    }
                }
            }

            if (_targetTrigger != null)
            {
                _targetTrigger.TriggerActivated += this.OnTriggerActivated;
            }
        }
Example #2
0
 private void UnregisterTargetTriggerEventHandler()
 {
     if (_targetTrigger != null)
     {
         _targetTrigger.TriggerActivated -= this.OnTriggerActivated;
         _targetTrigger = null;
     }
 }
 public void DeInit()
 {
     if (_targetEvent != null)
     {
         _targetEvent.EndHijack(this);
         _targetEvent.TriggerActivated -= this.OnTriggerActivated;
         _targetEvent = null;
     }
     _initialized = false;
 }
Example #4
0
 public void DeInit()
 {
     if (_targetEvent != null)
     {
         if (_hijackCache != null)
         {
             this.EndHijack();
         }
         _targetEvent.TriggerActivated -= this.OnTriggerActivated;
         _targetEvent = null;
     }
 }
Example #5
0
        public void Init()
        {
            if (_initialized)
            {
                return;
            }

            _initialized = true;
            if (_triggerIndex >= 0 && _target is IObservableTrigger)
            {
                var arr = (_target as IObservableTrigger).GetEvents();
                if (arr != null && _triggerIndex < arr.Length)
                {
                    _targetEvent = arr[_triggerIndex];
                    if (_targetEvent != null)
                    {
                        _targetEvent.TriggerActivated += this.OnTriggerActivated;
                    }
                }
            }
        }
 public Enumerator(BaseSPEvent t)
 {
     _e = t._targets.GetEnumerator();
 }
 public TargetList(BaseSPEvent owner)
 {
     _owner = owner;
 }