JsonButler-IDE
lets you use JsonButler's features inside your Visual Studio environment, along with some additional features.
- Generate C# types from JSON snippets/files.
- Serialize C# types to JSON text, from within Visual Studio (project does not need to be running).
- Easily change cases of phrases (to camelCase, lower_snake_case, PascalCase, and _underscoreCamelCase).
- More features coming soon!
Convert your JSON snippets easily into C# types usable in code.
For example:
automatically generates:
namespace Andeart.CustomPayloads
{
public class MyNewPayload
{
[JsonProperty ("name")]
public string Name { get; private set; }
[JsonProperty ("lines")]
public string[] Lines { get; private set; }
[JsonProperty ("winning_number")]
public int WinningNumber { get; private set; }
[JsonProperty ("new_type")]
public NewType NewType { get; private set; }
[JsonConstructor]
private MyNewPayload (string name, string[] lines, int winningNumber, NewType newType)
{
Name = name;
Lines = lines;
WinningNumber = winningNumber;
NewType = newType;
}
}
public class NewType
{
[JsonProperty ("nested_type")]
public NestedType NestedType { get; private set; }
[JsonConstructor]
private NewType (NestedType nestedType)
{
NestedType = nestedType;
}
}
public class NestedType
{
[JsonProperty ("id")]
public float Id { get; private set; }
[JsonConstructor]
private NestedType (float id)
{
Id = id;
}
}
}
Convert your C# payload types into JSON, using default values as needed.
For example:
public class HandleMaterial
{
public int MaterialName { get; }
public HandleMaterial (int materialName)
{
MaterialName = materialName;
}
}
public class HandleData
{
public float Strength { get; }
public HandleMaterial Material { get; }
[JsonIgnore]
public Handle Handle { get; private set; }
public HandleData (float strength, HandleMaterial material)
{
Strength = strength;
Material = material;
}
}
can be converted via the right-click context menu, to automatically generate this JSON snippet:
{
"strength": 0.0,
"material": {
"material_name": 0
}
}
Download the JsonButlerIde.vsix
file from the Github releases page.
Install the Visual Studio extension by running the .vsix
file.
This may also open up a dialog box that lets you choose which Visual Studio version you want to install this extension into.
Coming soon (maybe): A direct download from the Visual Studio Marketplace.
Please feel free to send in a Pull Request, or drop me an email. Cheers!