Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main Project Cleanup #1123

Merged
merged 6 commits into from
Jan 18, 2024
Merged

Main Project Cleanup #1123

merged 6 commits into from
Jan 18, 2024

Conversation

paulushub
Copy link
Contributor

@paulushub paulushub commented Jan 14, 2024

Description

  • Clean up of the main source code project
  • Removed irrelevant files
  • Added support for .NET 4.7, .NET 4.8
  • Removed preprocessor to enable events registration for all
  • Updates to the SvgOptions class to support key-value properties. Will use it to resolve issue raised in * Improve picture clarity #987
  • Split ItemGroup for references into supported Frameworks, so dependent package versions can be separately updated.
  • Resolved main concern in Added net6.0-windows to TFMs. #1019

Type of change

  • Removed https://svg.codeplex.com/ and https://svg.codeplex.com/license from description.
    Why? Links no longer exist.
  • Removed Microsoft.NETFramework.ReferenceAssemblies
    Why? SDK-style projects include this reference by default.
    Ref: https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/reference-assemblies
  • Dropped <Title>Svg for .Net Framework 4.6.2</Title> in project file for simplicity.
    • Why? Per-package title is not used/displayed by Visual Studio or nuget.org
  • Removed DisableImplicitFrameworkReferences for .NET 4.6.2
    • Why? Not applicable
  • Removed .NET 4 support preprocessors, like
    • Enum.TryParse: Is supported on all current platforms
    • string.Join(String, IEnumerable): Is supported on all current platforms
  • Dropped Svg.Enums.TryParse for System.Enum.TryParse: No longer needed
  • Removed irrelevant files
    • NuGet.Config: Empty NuGet configuration file
    • Svg.csproj.vspscc: Old MS Teams file
    • Svg.nuspec: Unsed NuGet package file
    • Svg.sln.DotSettings: Empty reshaper file
    • Svg.vsmdi: MSTest file
    • Local.testsettings: MSTest file
    • TraceAndTestImpact.testsettings: MSTest file
  • Clean up (non-breaking change which fixes an issue)
  • This change does not require a documentation update
  • Resolved review issues.

How Has This Been Tested?

  • SvgW3CTestRunner is tested for each supported platform
  • Svg.UnitTests tested on command line for each supported platform
  • Svg.Benchmarks tested on command line for each supported platform, warnings are as before will be addressed later.

- Clean up of the main source code project
- Removed irrelevant files
- Added support for .NET 4.7, .NET 4.8
- Removed preprocessor to enable events registration for all
- Updates to the SvgOptions class to support property attributes
Samples/Entities/Entities.csproj Outdated Show resolved Hide resolved
// return false;
// }
// }
//}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not needed bevause you just use Enum? In this case just remove it.
@H1Gdev may have a look as he introduced this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, we wait for @H1Gdev.
The generic support for the parsing enum string was not available in 3.5, so that might be needed but no more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paulushub @mrbean-bremen

I agree with remove it.
It would be beneficial to be able to remove [CLSCompliant(false)].

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@H1Gdev Thanks for the feedback. I will now remove the commented code.

Comment on lines +60 to +61
<DefineConstants Condition="$(TargetFramework.StartsWith('net47'))">$(DefineConstants);DOTNET47;NETFULL</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net48'))">$(DefineConstants);DOTNET48;NETFULL</DefineConstants>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added support for .NET Framework 4.7 and 4.8, for project using them.
The constants are provided in case any platform specific coding is necessary. Currently, only NETFULL is used.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, as long as there are no additional projects are build by default, it won't actually matter, so it is ok, I guess.

Tests/Svg.Benchmark/Svg.Benchmark.csproj Outdated Show resolved Hide resolved
- Applying the default "Format Document" introduces the tabs!
@paulushub
Copy link
Contributor Author

@mrbean-bremen Sorry for the crazy tabs, I have fixed it.
I only applied Edit -> Advanced -> Format Document, but unfortunately the tabify option is still on in my current machine.

Copy link
Member

@mrbean-bremen mrbean-bremen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but I would want to have @H1Gdev have another look.

@paulushub
Copy link
Contributor Author

Looks good to me, but I would want to have @H1Gdev have another look.

Thanks, trying to add him to the reviewers, but the name is not showing up.

@mrbean-bremen
Copy link
Member

Thanks, trying to add him to the reviewers, but the name is not showing up.

I also had tried to add him to the contributors. Anyway, he will get notifications from mentioning. And I think he is in a similar timezone as you, so it should be easier for you to communicate ;)

@paulushub
Copy link
Contributor Author

paulushub commented Jan 14, 2024

@mrbean-bremen Unfortunately, not all interpolation modes will allow the SVG-logo to pass the tests. So, I set the default as Default, let any user who wants to experiment with his/her desired mode of interpolation to use the SvgOptions.
Since this is not a W3C test file, I do not know how the reference PNG is created.

image

- Removed NuGet project files and folder
- Removed non-existence folder: <Folder Include="Web\Resources\" />
@@ -135,7 +135,7 @@ private static Graphics CreateGraphics(Image image)
g.CompositingQuality = CompositingQuality.HighQuality;
g.TextRenderingHint = TextRenderingHint.AntiAlias;
g.TextContrast = 1;
g.InterpolationMode = InterpolationMode.NearestNeighbor;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paulushub

Do you need to change this setting ?
I recommend that you change this setting carefully, such as by creating another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was added by a PR we allowed to record the contribution and close the issue as we planned to improve the implementation.
However, as you can see it is causing the build to fail with a SVG-Logo.
So, I set it to Default to make all the tests pass as before.

{
public SvgOptions()
public class SvgOptions : IDictionary<string, string>, ICloneable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to inherit Dictionary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted it to be as dictionary, we might change the base (and internal) to anything later.

- Enums no longer needed.
@paulushub paulushub self-assigned this Jan 16, 2024
@paulushub
Copy link
Contributor Author

paulushub commented Jan 16, 2024

@mrbean-bremen @H1Gdev Sorry, if it is OK with you, I will merge this PR.

@paulushub paulushub merged commit 18cb5e4 into svg-net:master Jan 18, 2024
7 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 18, 2024
…ples Source Svg.Custom Tests doc docfx.json index.md license.txt Main Project Cleanup - Clean up of the main source code project - Removed irrelevant files - Added support for .NET 4.7, .NET 4.8 - Removed preprocessor to enable events registration for all - Updates to the SvgOptions class to support property attributes CONTRIBUTING.md Generators README.md Samples Source Svg.Custom Tests doc docfx.json index.md license.txt Untabify the project files - Applying the default "Format Document" introduces the tabs! CONTRIBUTING.md Generators README.md Samples Source Svg.Custom Tests doc docfx.json index.md license.txt Restore the default interpolation mode of the GDI+ rendererer - Set the default mode to InterpolationMode.Default CONTRIBUTING.md Generators README.md Samples Source Svg.Custom Tests doc docfx.json index.md license.txt Further clean up - Removed NuGet project files and folder - Removed non-existence folder: <Folder Include="Web\Resources\" /> CONTRIBUTING.md Generators README.md Samples Source Svg.Custom Tests doc docfx.json index.md license.txt Removed the commented Enums static class - Enums no longer needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants