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

Commit

Permalink
v2.0.5.7
Browse files Browse the repository at this point in the history
   - Added ability to select tabs or spaces for indentation in generated code (Tools/Options/Entity Framework Visual Editor/Visual Editor Options) (See #221)
   - Fixed an issue with changing visual grid size on design surface.
  • Loading branch information
msawczyn committed Oct 7, 2020
1 parent c310a3b commit 2e44be9
Show file tree
Hide file tree
Showing 61 changed files with 3,229 additions and 957 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,18 @@ to <a href="https://www.jetbrains.com/?from=EFDesigner"><img src="https://msawcz

### Change Log

**2.0.5.6**
**2.0.5.7**
- Added ability to select tabs or spaces for indentation in generated code (Tools/Options/Entity Framework Visual Editor/Visual Editor Options) (See https://github.com/msawczyn/EFDesigner/issues/221)
- Fixed an issue with changing visual grid size on design surface.

<details>
<summary><b>2.0.5.6</b></summary>

- The project item templates for the model file had wandered away. They're back again. (See https://github.com/msawczyn/EFDesigner/issues/216)
- Fixed a problem with existing models where class-level "AutoProperty: false" caused bad code generation. (See https://github.com/msawczyn/EFDesigner/issues/215)

</details>

<details>
<summary><b>2.0.5.5</b></summary>

Expand Down
4 changes: 4 additions & 0 deletions VSMarketplace blurb.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ For comprehensive documentation, please visit [the project's documentation site]

**ChangeLog**

**2.0.5.7**
- **[NEW]** Added ability to select tabs or spaces for indentation in generated code (Tools/Options/Entity Framework Visual Editor/Visual Editor Options) (See https://github.com/msawczyn/EFDesigner/issues/221)
- Fixed an issue with changing visual grid size on design surface.

**2.0.5.6**
- The project item templates for the model file had wandered away. They're back again. (See https://github.com/msawczyn/EFDesigner/issues/216)
- Fixed a problem with existing models where class-level "AutoProperty: false" caused bad code generation. (See https://github.com/msawczyn/EFDesigner/issues/215)
Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2.0.5.7
- Added ability to select tabs or spaces for indentation in generated code (Tools/Options/Entity Framework Visual Editor/Visual Editor Options) (See https://github.com/msawczyn/EFDesigner/issues/221)
- Fixed an issue with changing visual grid size on design surface.

2.0.5.6
- The project item templates for the model file had wandered away. They're back again. (See https://github.com/msawczyn/EFDesigner/issues/216)
- Fixed a problem with existing models where class-level "AutoProperty: false" caused bad code generation. (See https://github.com/msawczyn/EFDesigner/issues/215)
Expand Down
Binary file modified dist/Sawczyn.EFDesigner.EFModel.DslPackage.vsix
Binary file not shown.
2 changes: 0 additions & 2 deletions src/Dsl/CustomCode/Partials/EFModelDiagram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ public override void OnInitialize()
ShowGrid = modelRoot?.ShowGrid ?? true;
GridColor = modelRoot?.GridColor ?? Color.Gainsboro;
SnapToGrid = modelRoot?.SnapToGrid ?? true;
GridSize = modelRoot?.GridSize ?? 0.125;

}

/// <summary>
Expand Down
37 changes: 22 additions & 15 deletions src/Dsl/CustomCode/Partials/ModelRoot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public partial class ModelRoot: IHasStore

public static Func<bool> WriteDiagramAsBinary = () => false;

public static Func<bool> UseTabs = () => false;

static ModelRoot()
{
try
Expand All @@ -42,7 +44,7 @@ static ModelRoot()
// ReSharper disable once UnusedMember.Global
public string FullName => string.IsNullOrWhiteSpace(Namespace) ? $"global::{EntityContainerName}" : $"global::{Namespace}.{EntityContainerName}";

public bool IsEFCore5Plus => EntityFrameworkVersion == EFVersion.EFCore && GetEntityFrameworkPackageVersionNum() >= 5;
public bool IsEFCore5Plus => EntityFrameworkVersion == EFVersion.EFCore && (EntityFrameworkPackageVersion == "Latest" || GetEntityFrameworkPackageVersionNum() >= 5);

[Obsolete("Use ModelRoot.Classes instead")]
public LinkedElementCollection<ModelClass> Types => Classes;
Expand All @@ -57,6 +59,22 @@ public EFModelDiagram[] GetDiagrams()
.ToArray();
}

#region Filename

private string filename;

public void SetFileName(string fileName)
{
filename = fileName;
}

public string GetFileName()
{
return filename;
}

#endregion

#region OutputLocations

private OutputLocations outputLocationsStorage;
Expand Down Expand Up @@ -271,8 +289,9 @@ public NuGetDisplay NuGetPackageVersion
{
get
{
return NuGetHelper.NuGetPackageDisplay.FirstOrDefault(x => x.EFVersion == EntityFrameworkVersion &&
x.DisplayVersion == EntityFrameworkPackageVersion);
return NuGetHelper.NuGetPackageDisplay
.FirstOrDefault(x => x.EFVersion == EntityFrameworkVersion
&& x.DisplayVersion == EntityFrameworkPackageVersion);
}
}

Expand Down Expand Up @@ -479,17 +498,5 @@ protected override void OnValueChanged(ModelRoot element, string oldValue, strin
}

#endregion Namespace tracking property

private string filename;

public void SetFileName(string fileName)
{
filename = fileName;
}

public string GetFileName()
{
return filename;
}
}
}
2 changes: 1 addition & 1 deletion src/Dsl/CustomCode/Rules/ModelAttributeChangeRules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public override void ElementPropertyChanged(ElementPropertyChangedEventArgs e)
if (Equals(e.NewValue, e.OldValue))
return;

List<string> errorMessages = EFCoreValidator.GetErrors(element).ToList();
List<string> errorMessages = new List<string>();

switch (e.DomainProperty.Name)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Dsl/CustomCode/Rules/ModelClassChangeRules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public override void ElementPropertyChanged(ElementPropertyChangedEventArgs e)
if (Equals(e.NewValue, e.OldValue))
return;

List<string> errorMessages = EFCoreValidator.GetErrors(element).ToList();
List<string> errorMessages = new List<string>();

switch (e.DomainProperty.Name)
{
Expand Down
11 changes: 2 additions & 9 deletions src/Dsl/CustomCode/Rules/ModelRootChangeRules.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.CodeDom.Compiler;
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
Expand Down Expand Up @@ -125,14 +126,6 @@ public override void ElementPropertyChanged(ElementPropertyChangedEventArgs e)

break;

case "GridSize":
foreach (EFModelDiagram diagram in element.GetDiagrams())
diagram.GridSize = (double)e.NewValue/10.0;

redraw = true;

break;

case "InheritanceStrategy":

if ((element.EntityFrameworkVersion == EFVersion.EFCore) && (element.NuGetPackageVersion.MajorMinorVersionNum < 2.1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ private PropertyDescriptorCollection GetCustomProperties(Attribute[] attributes)
{
storeDomainDataDirectory = association.Store.DomainDataDirectory;

EFCoreValidator.AdjustEFCoreProperties(propertyDescriptors, association);

// show FKPropertyName only when possible and required
if (!association.Source.ModelRoot.ExposeForeignKeys
|| (association.SourceRole != EndpointRole.Dependent && association.TargetRole != EndpointRole.Dependent))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@ private PropertyDescriptorCollection GetCustomProperties(Attribute[] attributes)

if (ModelElement is ModelClass modelClass)
{
EFCoreValidator.AdjustEFCoreProperties(propertyDescriptors, modelClass);

storeDomainDataDirectory = modelClass.Store.DomainDataDirectory;



//Add the descriptors for the tracking properties

propertyDescriptors.Add(new TrackingPropertyDescriptor(modelClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ private PropertyDescriptorCollection GetCustomProperties(Attribute[] attributes)
{
storeDomainDataDirectory = modelEnum.Store.DomainDataDirectory;

EFCoreValidator.AdjustEFCoreProperties(propertyDescriptors, modelEnum);

//Add the descriptors for the tracking properties

propertyDescriptors.Add(new TrackingPropertyDescriptor(modelEnum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ private PropertyDescriptorCollection GetCustomProperties(Attribute[] attributes)
{
EFCoreValidator.AdjustEFCoreProperties(propertyDescriptors, modelRoot);

if (!modelRoot.ShowGrid)
{
propertyDescriptors.Remove("GridColor");
}

//Add in extra custom properties here...
}

Expand Down
Loading

0 comments on commit 2e44be9

Please sign in to comment.