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

More Converters csv2json, json2csharp, xml2charp, etc. #1220

Open
agravity-philipp opened this issue Jun 13, 2024 · 4 comments
Open

More Converters csv2json, json2csharp, xml2charp, etc. #1220

agravity-philipp opened this issue Jun 13, 2024 · 4 comments
Labels
feature Feature / Tool request or idea untriaged

Comments

@agravity-philipp
Copy link

What feature or new tool do you think should be added to DevToys?

I want to have more convers like these:
https://json2csharp.com/code-converters/xml-to-csharp

Why do you think this is needed?

Because I need them and there are a lot of them on the internet. And I want to have it in my "army knife".

Solution/Idea

Auto-Detect would be nice. So I just have to set the format I want to have it converted.
A big textbox on the left and a big textbox on the right. Above there is a dropdown of supported languages.

Comments

No response

@agravity-philipp agravity-philipp added feature Feature / Tool request or idea untriaged labels Jun 13, 2024
@cloudfy
Copy link

cloudfy commented Jun 17, 2024

We've added https://www.nuget.org/packages/DevToys.JsonToCsharp initial release 1.0.5 to DevToys 2.0.1. Happy to take feature requests and more inputs.

@veler
Copy link
Collaborator

veler commented Jun 17, 2024

We've added https://www.nuget.org/packages/DevToys.JsonToCsharp initial release 1.0.5 to DevToys 2.0.1. Happy to take feature requests and more inputs.

Hi @cloudfy , this is awesome! I tested it and it works great so far !

image

One advice:

You can colorize the JSON and C# text automatically by using the Language method on the MultilineTextInput.

Example:

MultiLineTextInput()
                        .Title("JSON editor")
                        .Language("json");

This will colorize the code like this:

image

@cloudfy
Copy link

cloudfy commented Jun 17, 2024

Amazing, added to 1.0.7. Just released :) - you may close the topic.

@veler
Copy link
Collaborator

veler commented Jun 18, 2024

Awesome! Thanks !
Well, this topic mentions other things than Json to C#, but I see your point.

By the way, how about supporting Smart Detection in your tool? https://devtoys.app/doc/articles/extension-development/guidelines/UX/support-smart-detection.html
In your case, I believe all you need to do is adding [AcceptedDataTypeName(PredefinedCommonDataTypeNames.Json)] to your IGuiTool. The intercept the data and place it in the input text box, like this:

https://github.com/DevToys-app/DevToys.Tools/blob/59bda4213ea21e5f8f40259ddec7579d9ad363d1/src/DevToys.Tools/Tools/Formatters/Json/JsonFormatterGuiTool.cs#L125C1-L133C6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature / Tool request or idea untriaged
Projects
None yet
Development

No branches or pull requests

3 participants