AGS.Editor.TabbedDocumentManager.TreeContextMenuEventHandler C# (CSharp) Метод

TreeContextMenuEventHandler() приватный Метод

private TreeContextMenuEventHandler ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Результат void
        private void TreeContextMenuEventHandler(object sender, EventArgs e)
        {
            ToolStripMenuItem item = (ToolStripMenuItem)sender;
            ContentDocument document = (ContentDocument)item.Owner.Tag;
            if (item.Name == MENU_ITEM_CLOSE)
            {
                RemoveDocument(document, true);
            }
            else if (item.Name == MENU_ITEM_CLOSE_ALL)
            {
                if (Factory.AGSEditor.Preferences.DialogOnMultibleTabsClose && MessageBox.Show("Are you sure you want to close all tabs?", "Confirm close", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    return;

                RemoveAllDocuments(null); // null -> Remove all documents, no exceptions
            }
            else if (item.Name == MENU_ITEM_CLOSE_ALL_BUT_THIS)
            {
                if (Factory.AGSEditor.Preferences.DialogOnMultibleTabsClose && MessageBox.Show("Are you sure you want to close all other tabs?", "Confirm close", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    return;

                RemoveAllDocuments(document);
            }
            else if (item.Name == MENU_ITEM_NAVIGATE)
            {
                Factory.GUIController.ProjectTree.SelectNode(null, document.TreeNodeID);

            }
        }