コード例 #1
0
 private void mi_delete(object sender, EventArgs e)
 {
     if (_act != null)
     {
         EventPath ep = this.Parent as EventPath;
         if (ep != null)
         {
             ClassPointer root = ep.Loader.GetRootId();
             root.AskDeleteAction(_act, this.FindForm());
         }
     }
 }
コード例 #2
0
        private void mi_removeAction(object sender, EventArgs e)
        {
            MenuItem mi = sender as MenuItem;

            if (mi != null)
            {
                ClassPointer root = _panes.Loader.GetRootId();
                IAction      act  = mi.Tag as IAction;
                if (act != null)
                {
                    root.AskDeleteAction(act, this.FindForm());
                }
                else
                {
                    TaskID tid = mi.Tag as TaskID;
                    if (tid != null)
                    {
                        HandlerMethodID hid = tid as HandlerMethodID;
                        if (hid != null)
                        {
                            root.AskDeleteMethod(hid.HandlerMethod, this.FindForm());
                        }
                        else
                        {
                            if (tid.Action == null)
                            {
                                tid.LoadActionInstance(root);
                            }
                            if (tid.Action != null)
                            {
                                root.AskDeleteAction(tid.Action, this.FindForm());
                            }
                        }
                    }
                }
            }
        }