Esempio n. 1
0
        protected bool SendOnRemove(int index)
        {
            bool doIt = true;

            if (null != OnRemove)
            {
                foreach (EventHandler <CancelSelectEventArgs <int> > inv in OnRemove.GetInvocationList())
                {
                    try
                    {
                        CancelSelectEventArgs <int> args = new CancelSelectEventArgs <int>(index);
                        inv(this, args);
                        if (args.Cancel)
                        {
                            doIt = false;
                        }
                    }
                    catch (Exception exception)
                    {
                        Log.postException(exception);
                    }
                }
            }
            return(doIt);
        }
Esempio n. 2
0
 public void InvokeOnRemove()
 {
     LoginControl.OnLoginsEnabled -= LoginsEnabledHandler;
     foreach (Action <SceneInterface> del in OnRemove?.GetInvocationList() ?? new Delegate[0])
     {
         try
         {
             del(this);
         }
         catch (Exception e)
         {
             m_Log.DebugFormat("Exception {0}:{1} at {2}", e.GetType().Name, e.Message, e.StackTrace);
         }
     }
 }