Exemplo n.º 1
0
 private void TreeNodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     var node = e.Node;
     var item = new MenuItemClickedEventArgs { Key = node.Name, InvokeKey = String.Empty };
     this.MenuItemClicked(sender, item);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Trivs the menu menu item clicked.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="MenuItemClickedEventArgs"/> instance containing the event data.</param>
        private void TrivMenuMenuItemClicked(object sender, MenuItemClickedEventArgs e)
        {
            //var item = (ToolStripMenuItem) sender;
            //if (item == null) return;
            //var menuItem = (TopMenuItem) item.Tag;
            //if (menuItem == null) return;

            if (!string.IsNullOrEmpty(e.Key)) {
                this.ViewManager.ShowDocument(e.Key);
                return; ;
            }

            if (!string.IsNullOrEmpty(e.InvokeKey))
            {
                switch (e.InvokeKey)
                {
                    case "SysmteExit":
                        DialogResult result = MessageDialog.Instance.ShowMessage(this, "MSG0002");
                        if (result == DialogResult.Yes) Application.Exit();
                        break;;
                    default:
                        break;
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Handles the Click event of the toolTrip control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void ToolTripClick(object sender, EventArgs e)
        {
            if (this.MenuItemClicked == null) return;
            var menuItem = (ToolStripMenuItem) sender;
            var topItem = (TopMenuItem) menuItem.Tag;

            //var pro = sender.GetType().GetProperty("Name");
            //var name = pro.GetValue(sender, null).ToString();
            var item = new MenuItemClickedEventArgs { Key = topItem.Key, InvokeKey = topItem .InvokeKey};
            this.MenuItemClicked(sender, item);
        }