src/Misc/EFTools/EntityDesignPackage/CustomCode/MicrosoftDataEntityDesignCommandSet.cs
/// <summary>
///     Show Open Diagram menu item only if the selected item in model browser is a Diagram.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
Show Open Diagram menu item only if the selected item in model browser is a Diagram.
Show Open Diagram menu item only if the selected item in model browser is a Diagram .
internal void OnStatusOpenDiagram(object sender, EventArgs e)
        {
            var cmd = sender as MenuCommand;
            if (null != cmd)
            {
                cmd.Enabled = cmd.Visible = false;
                var diagram = GetDiagram();
                if (diagram == null)
                {
                    var explorerSelection = SelectedExplorerItem;
                    if (explorerSelection is ExplorerDiagram)
                    {
                        cmd.Enabled = cmd.Visible = true;
                        return;
                    }
                }
            }
        }
internal void OnStatusOpenDiagram ( object sender , EventArgs e ) { var cmd = sender as MenuCommand ; if ( null != cmd ) { cmd . Enabled = cmd . Visible = false ; var diagram = GetDiagram ( ) ; if ( diagram == null ) { var explorerSelection = SelectedExplorerItem ; if ( explorerSelection is ExplorerDiagram ) { cmd . Enabled = cmd . Visible = true ; return ; } } } }
Show Open Diagram menu item only if the selected item in model browser is a Diagram.
Show Open Diagram menu item only if the selected item in model browser is a Diagram .
// only show this if the ExplorerItem is in focus (GetDiagram should return null).
sender
object
None
e
EventArgs
None