Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Reshuffle context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
msawczyn committed May 14, 2021
1 parent a2a22e9 commit f093a2b
Show file tree
Hide file tree
Showing 15 changed files with 146 additions and 112 deletions.
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
3.0.6
- Added ability to copy current diagram to clipboard

3.0.5
- Fix where parsing EF version numbers should be culture-neutral (see https://github.com/msawczyn/EFDesigner/issues/282)
- Fixed circular logic flaw in identity properties for database views (see https://github.com/msawczyn/EFDesigner/issues/275)
Expand Down
2 changes: 1 addition & 1 deletion src/Dsl/DslDefinition.dsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Dsl xmlns:dm0="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" dslVersion="1.0.0.0" Id="9987f227-3d05-49b7-b151-857879f5dfb8" Description="Entity Framework visual editor for EF6, EFCore and beyond." Name="EFModel" DisplayName="Entity Framework Visual Editor" Namespace="Sawczyn.EFDesigner.EFModel" MajorVersion="3" Build="5" Revision="2" ProductName="EFDesigner" CompanyName="Michael Sawczyn" PackageGuid="56bbe1ba-aaee-4883-848f-e3c8656f8db2" PackageNamespace="Sawczyn.EFDesigner.EFModel" xmlns="http://schemas.microsoft.com/VisualStudio/2005/DslTools/DslDefinitionModel">
<Dsl xmlns:dm0="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" dslVersion="1.0.0.0" Id="9987f227-3d05-49b7-b151-857879f5dfb8" Description="Entity Framework visual editor for EF6, EFCore and beyond." Name="EFModel" DisplayName="Entity Framework Visual Editor" Namespace="Sawczyn.EFDesigner.EFModel" MajorVersion="3" Build="6" ProductName="EFDesigner" CompanyName="Michael Sawczyn" PackageGuid="56bbe1ba-aaee-4883-848f-e3c8656f8db2" PackageNamespace="Sawczyn.EFDesigner.EFModel" xmlns="http://schemas.microsoft.com/VisualStudio/2005/DslTools/DslDefinitionModel">
<Classes>
<DomainClass Id="95532cb8-3452-4b09-a654-aeb2e2d0b3ad" Description="" Name="ModelRoot" DisplayName="Entity Model" Namespace="Sawczyn.EFDesigner.EFModel">
<CustomTypeDescriptor>
Expand Down
68 changes: 34 additions & 34 deletions src/Dsl/DslDefinition.dsl.diagram

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Dsl/GeneratedCode/DomainClasses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13526,6 +13526,6 @@ namespace Sawczyn.EFDesigner.EFModel
/// </summary>
partial class ModelRoot
{
public const string DSLVersion = "3.0.5.2";
public const string DSLVersion = "3.0.6.0";
}
}
4 changes: 2 additions & 2 deletions src/Dsl/GeneratedCode/SerializationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ public virtual void WriteRootElement(DslModeling::SerializationContext serializa
// Only model has schema, diagram has no schema.
rootElementSettings.SchemaTargetNamespace = "http://schemas.microsoft.com/dsltools/EFModel";
}
rootElementSettings.Version = new global::System.Version("3.0.5.2");
rootElementSettings.Version = new global::System.Version("3.0.6.0");

// Carry out the normal serialization.
rootSerializer.Write(serializationContext, rootElement, writer, rootElementSettings);
Expand All @@ -1190,7 +1190,7 @@ protected virtual void CheckVersion(DslModeling::SerializationContext serializat
throw new global::System.ArgumentNullException("reader");
#endregion

global::System.Version expectedVersion = new global::System.Version("3.0.5.2");
global::System.Version expectedVersion = new global::System.Version("3.0.6.0");
string dslVersionStr = reader.GetAttribute("dslVersion");
if (dslVersionStr != null)
{
Expand Down
136 changes: 66 additions & 70 deletions src/DslPackage/Commands.vsct

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions src/DslPackage/CustomCode/CommandSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ internal partial class EFModelCommandSet
private const int cmdidRemoveShape = 0x001E;
private const int cmdidAddForeignKeys = 0x001F;
private const int cmdidDelForeignKeys = 0x0020;
private const int cmdidImageToClipboard = 0x0021;

private const int cmdidSelectClasses = 0x0101;
private const int cmdidSelectEnums = 0x0102;
Expand Down Expand Up @@ -178,6 +179,15 @@ protected override IList<MenuCommand> GetMenuCommands()

#endregion

#region imageToClipboard

DynamicStatusMenuCommand imageToClipboard =
new DynamicStatusMenuCommand(OnStatusImageToClipboard, OnMenuImageToClipboard, new CommandID(guidEFDiagramMenuCmdSet, cmdidImageToClipboard));

commands.Add(imageToClipboard);

#endregion

#region loadNuGetCommand

#pragma warning disable 612
Expand Down Expand Up @@ -1018,6 +1028,31 @@ private ImageFormat GetFormat(string fileName)

#endregion

#region Image to Clipboard

private void OnStatusImageToClipboard(object sender, EventArgs e)
{
if (sender is MenuCommand command)
{
command.Visible = true;
command.Enabled = IsDiagramSelected() && !IsCurrentDiagramEmpty();
}
}

private void OnMenuImageToClipboard(object sender, EventArgs e)
{
Diagram currentDiagram = CurrentDocView?.CurrentDiagram;

if (currentDiagram == null)
return;

Bitmap bitmap = currentDiagram.CreateBitmap(currentDiagram.NestedChildShapes,
Diagram.CreateBitmapPreference.FavorClarityOverSmallSize);
Clipboard.SetImage(bitmap);
}

#endregion

#region Load NuGet

[Obsolete]
Expand Down
2 changes: 1 addition & 1 deletion src/DslPackage/GeneratedCode/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal static partial class Constants
[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
public const string CompanyName = @"Michael Sawczyn";
[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
public const string ProductVersion = "3.0.5.2";
public const string ProductVersion = "3.0.6.0";

// Menu definitions
public static readonly global::System.ComponentModel.Design.CommandID EFModelDiagramMenu = new global::System.ComponentModel.Design.CommandID(new global::System.Guid(EFModelCommandSetId), 0x10000);
Expand Down
2 changes: 1 addition & 1 deletion src/DslPackage/GeneratedCode/Package.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ namespace Sawczyn.EFDesigner.EFModel
/// <summary>
/// Double-derived class to allow easier code customization.
/// </summary>
[VSShell::ProvideMenuResource("1000.ctmenu", version: 40)]
[VSShell::ProvideMenuResource("1000.ctmenu", version: 43)]
[VSShell::ProvideToolboxItems(1)]
[global::Microsoft.VisualStudio.TextTemplating.VSHost.ProvideDirectiveProcessor(typeof(global::Sawczyn.EFDesigner.EFModel.EFModelDirectiveProcessor), global::Sawczyn.EFDesigner.EFModel.EFModelDirectiveProcessor.EFModelDirectiveProcessorName, "A directive processor that provides access to EFModel files")]
[global::System.Runtime.InteropServices.Guid(Constants.EFModelPackageId)]
Expand Down
2 changes: 1 addition & 1 deletion src/DslPackage/GeneratedCode/Package.tt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace <#= CodeGenerationUtilities.GetPackageNamespace(this.Dsl) #>
/// <summary>
/// Double-derived class to allow easier code customization.
/// </summary>
[VSShell::ProvideMenuResource("1000.ctmenu", version: 40)]
[VSShell::ProvideMenuResource("1000.ctmenu", version: 43)]
[VSShell::ProvideToolboxItems(1)]
[global::Microsoft.VisualStudio.TextTemplating.VSHost.ProvideDirectiveProcessor(typeof(global::<#= this.Dsl.Namespace #>.<#= directiveName #>DirectiveProcessor), global::<#= this.Dsl.Namespace #>.<#= directiveName #>DirectiveProcessor.<#= directiveName #>DirectiveProcessorName, "A directive processor that provides access to <#= directiveName #> files")]
[global::System.Runtime.InteropServices.Guid(Constants.<#= dslName #>PackageId)]
Expand Down
Binary file modified src/DslPackage/Parsers/EF6Parser.exe
Binary file not shown.
Binary file modified src/DslPackage/Parsers/EFCore2Parser.exe
Binary file not shown.
Binary file modified src/DslPackage/Parsers/EFCore3Parser.exe
Binary file not shown.
Binary file modified src/DslPackage/Parsers/EFCore5Parser.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion src/DslPackage/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="56bbe1ba-aaee-4883-848f-e3c8656f8db2" Version="3.0.5.2" Language="en-US" Publisher="Michael Sawczyn" />
<Identity Id="56bbe1ba-aaee-4883-848f-e3c8656f8db2" Version="3.0.6.0" Language="en-US" Publisher="Michael Sawczyn" />
<DisplayName>Entity Framework Visual Editor</DisplayName>
<Description>Entity Framework visual editor for EF6, EFCore and beyond.</Description>
<Icon>Logo.ico</Icon>
Expand Down

0 comments on commit f093a2b

Please sign in to comment.