Example #1
0
 private void miCancel_Click(object sender, EventArgs e)
 {
     if (_Menu != null && ShortCutItemCancel != null)
     {
         ShortCutItemClickEventArgs arg = new ShortCutItemClickEventArgs();
         arg.Menu = _Menu;
         ShortCutItemCancel(this, arg);
     }
 }
 private void flpMenuList_DragDrop(object sender, DragEventArgs e)
 {
     if (e.Data.GetDataPresent("System.Windows.Controls.TreeViewItem", false))
     {
         // 获取被拖动的节点
         var treeNode = (TreeViewItem)e.Data.GetData("System.Windows.Controls.TreeViewItem");
         var dMenu    = treeNode.Tag as DMenu;
         if (!_ItemList.ContainsKey(dMenu.Guid))
         {
             //触发快捷菜单保存
             var arg = new ShortCutItemClickEventArgs();
             arg.Menu = dMenu;
             AddShortCutItem(this, arg);
         }
     }
 }
 private void AddShortCutMenuItem(object sender, ShortCutItemClickEventArgs e)
 {
     SaveShortCutMenuConfig(e.Menu, true);
 }
 private void CancelShortCutMenuItem_Click(object sender, ShortCutItemClickEventArgs e)
 {
     SaveShortCutMenuConfig(e.Menu, false);
 }
 private void ShortCutMenuItem_Click(object sender, ShortCutItemClickEventArgs e)
 {
     OpenMenu(e.Menu, true);
 }