public ConnectionContextMenu(ConnectionTree connectionTree) { _connectionTree = connectionTree; _connectionInitiator = new ConnectionInitiator(); InitializeComponent(); ApplyLanguage(); EnableShortcutKeys(); Opening += (sender, args) => { AddExternalApps(); ShowHideMenuItems(); }; Closing += (sender, args) => EnableMenuItemsRecursive(Items); }
public ConnectionContextMenu(ConnectionTree connectionTree) { _connectionTree = connectionTree; _connectionInitiator = new ConnectionInitiator(); InitializeComponent(); ApplyLanguage(); EnableShortcutKeys(); Opening += (sender, args) => { AddExternalApps(); if (_connectionTree.SelectedNode == null) { args.Cancel = true; return; } ShowHideMenuItems(); }; }