src/Misc/EFTools/EntityDesignPackage/CustomCode/MicrosoftDataEntityDesignCommandSet.cs
/// <summary>
///     Menu item to allow the user move diagram nodes to a separate file.
/// </summary>
Menu item to allow the user move diagram nodes to a separate file.
Menu item to allow the user move diagram nodes to a separate file .
internal void OnStatusMoveDiagramsToSeparateFile(object sender, EventArgs e)
        {
            var cmd = sender as MenuCommand;
            if (null != cmd)
            {
                cmd.Enabled = cmd.Visible = false;
                var uri = Utils.FileName2Uri(CurrentDocData.FileName);
                var artifactProjectItem = VsUtils.GetProjectItemForDocument(uri.LocalPath, Services.ServiceProvider);
                if (artifactProjectItem != null
                    && VsUtils.IsLinkProjectItem(artifactProjectItem) == false)
                {
                    var modelManager = PackageManager.Package.ModelManager;
                    var artifact = modelManager.GetArtifact(uri) as EntityDesignArtifact;
                    Debug.Assert(artifact != null, "There is no EntityDesignArtifact with URI:" + uri.LocalPath + " in modelmanager.");
                    if (artifact != null
                        && artifact.DiagramArtifact == null)
                    {
                        cmd.Enabled = cmd.Visible = true;
                    }
                }
            }
        }
internal void OnStatusMoveDiagramsToSeparateFile ( object sender , EventArgs e ) { var cmd = sender as MenuCommand ; if ( null != cmd ) { cmd . Enabled = cmd . Visible = false ; var uri = Utils . FileName2Uri ( CurrentDocData . FileName ) ; var artifactProjectItem = VsUtils . GetProjectItemForDocument ( uri . LocalPath , Services . ServiceProvider ) ; if ( artifactProjectItem != null && VsUtils . IsLinkProjectItem ( artifactProjectItem ) == false ) { var modelManager = PackageManager . Package . ModelManager ; var artifact = modelManager . GetArtifact ( uri ) as EntityDesignArtifact ; Debug . Assert ( artifact != null , " " + uri . LocalPath + " " ) ; if ( artifact != null && artifact . DiagramArtifact == null ) { cmd . Enabled = cmd . Visible = true ; } } } }
Menu item to allow the user move diagram nodes to a separate file.
Menu item to allow the user move diagram nodes to a separate file .
// check whether the EDMX Project Item is a link. // Only show if the diagram artifact is not null
sender
object
e
EventArgs