Ejemplo n.º 1
0
        private void SystemMenuItem_Click(object sender, EventArgs e)
        {
            MenuTreeNode ClickedNode = null;

            MenuNodeDictionary.TryGetValue((System.Windows.Forms.ToolStripItem)sender, out ClickedNode);
            SystemMenuTreeNode SystemMenuNode = ClickedNode as SystemMenuTreeNode;

            if (SystemMenuNode != null)
            {
                SystemMenuNode.Execute();
            }
        }
        private void SystemButton_Click(object sender, RoutedEventArgs e)
        {
            this.Hide();
            MenuTreeNode ClickedNode = null;

            System.Windows.Controls.Button ClickedButton = (System.Windows.Controls.Button)sender;
            MenuNodeDictionary.TryGetValue(ClickedButton, out ClickedNode);
            SystemMenuTreeNode SystemMenuNode = ClickedNode as SystemMenuTreeNode;

            if (SystemMenuNode != null)
            {
                SystemMenuNode.Execute();
            }
        }