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

Add Linq-to-XML example #1101

Merged
merged 2 commits into from
Dec 16, 2021

Conversation

ThomasBarnekow
Copy link
Collaborator

Based on the SVGExample currently added in PR #1087, this pull request adds corresponding examples that demonstrate two approaches:

  1. the Linq-to-XML way of creating markup, using the Linq-to-XML feature provided by DocumentFormat.OpenXml.Linq and
  2. a strongly-typed way of creating markup that is closer to how you would do it in the Linq-to-XML way.

Let's discuss how we deal with the strongly-typed example. We can do multiple things. Firstly, we could demonstrate different code styles developers can use. Secondly, we could replace the original one with this one.

By the way, I am still using Visual Studio 2019, which is the reason for the initial changes in the solution file. I'm not sure whether that is an issue. One issue, however, is that you've used language version 10.0, which requires .NET 6.0, which requires Visual Studio 2022, which not everybody might have. I'm not sure whether you are using the very latest language features and whether this is really required.

@ThomasBarnekow
Copy link
Collaborator Author

@twsouthwick and @mikeebowen, please have a look at the examples.

@mikeebowen, if we keep both your original SVGExample (see samples/SVGExample/Program.cs in your PR) and the example provided by the StronglyTypedTools class, would it make sense for you to consider some features that I included in my example? For example:

  • The creation ID is not a fixed string (GUID in curly braces) but created as a unique ID for each image. Your example suggests it might be a fixed string.
  • The image size and position are not fixed but derived from the slide height. This is optional. However, it shows that developers need to think about sizing and positioning.

@twsouthwick
Copy link
Member

@mikeebowen I like the features @ThomasBarnekow has. Can you incorporate them? It would be great to keep the samples similar.

@twsouthwick
Copy link
Member

twsouthwick commented Dec 15, 2021

Yes, I'm using C# 10 features such as latest code generator stuff as well as the .NET 6 SDK (which has other goodness besides just C# 10 stuff and .NET 6 support - it has build time improvements I want to take advantage of). Generally, I keep the repo using the latest tool chains and will adopt that as useful. The resulting builds will still work as-is, but want to be able to use the latest as soon as possible :)

@twsouthwick
Copy link
Member

I like the idea of both. Then it shows the different styles and we can compare them fairly easily

@twsouthwick
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@twsouthwick twsouthwick left a comment

Choose a reason for hiding this comment

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

LGTM. My only concern is if the image is ok to store in the repo (not sure about licensing of images)

@ThomasBarnekow
Copy link
Collaborator Author

LGTM. My only concern is if the image is ok to store in the repo (not sure about licensing of images)

I took a free image from https://freesvg.org/. They seemingly have no copyright and come with the CC0 1.0 Universal (CC0 1.0)
Public Domain Dedication. However, I could take any other image with copyright by MS that you might have.

@twsouthwick
Copy link
Member

Can you add an attribution to either the csproj/readme/additional file?

@ThomasBarnekow
Copy link
Collaborator Author

Can you add an attribution to either the csproj/readme/additional file?

Done. See .csproj file.

@twsouthwick
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@twsouthwick twsouthwick merged commit 3c774d4 into dotnet:main Dec 16, 2021
@ThomasBarnekow ThomasBarnekow deleted the feature/linq-to-xml-example branch December 16, 2021 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants