src/Misc/EFTools/EntityDesignPackage/CustomCode/MicrosoftDataEntityDesignCommandSet.cs
/// <summary>
///     Determine whether to show create diagram menu item. We only want to display it if the Diagram container is selected.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
Determine whether to show create diagram menu item. We only want to display it if the Diagram container is selected.
Determine whether to show create diagram menu item . We only want to display it if the Diagram container is selected .
internal void OnStatusAddNewDiagram(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 ExplorerDiagrams
                        || explorerSelection is ExplorerDiagram)
                    {
                        cmd.Enabled = cmd.Visible = true;
                        return;
                    }
                }
            }
        }
internal void OnStatusAddNewDiagram ( 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 ExplorerDiagrams || explorerSelection is ExplorerDiagram ) { cmd . Enabled = cmd . Visible = true ; return ; } } } }
Determine whether to show create diagram menu item.
Determine whether to show create diagram menu item .
// only show this if the ExplorerItem is in focus (GetDiagram should return null).
sender
object
None
e
EventArgs
None