예제 #1
0
 public static SEventProxy getInstance()
 {
     if (instance == null)
     {
         instance = new SEventProxy();
     }
     return(instance);
 }
예제 #2
0
            public bool Invoke(object sender, TEventArgs e)
            {
                object target = null;

                if (_weakTarget != null)
                {
                    if (!_weakTarget.IsAlive)
                    {
                        return(false);
                    }
                    target = _weakTarget.Target;
                }
                if (SEventProxy.CanFireEvent(e.GetType()))
                {
                    // if we are on UI thread just invoke if not go trough InvokeDelegate
                    if (!SEventProxy.InvokeOnUIThread(_openHandler, new object[] { target, sender, e }))
                    {
                        _openHandler(target, sender, e);
                    }
                }
                return(true);
            }
예제 #3
0
 protected void setup()
 {
     //get proxy, so we are sure it exists
     _eventProxy = SEventProxy.getInstance();
 }