-Code reformat
This commit is contained in:
@@ -7,26 +7,26 @@ using System.Text;
|
||||
|
||||
namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
|
||||
{
|
||||
public class SaveJsonSchemaToFile
|
||||
{
|
||||
public void Example()
|
||||
public class SaveJsonSchemaToFile
|
||||
{
|
||||
#region Usage
|
||||
JsonSchema schema = new JsonSchema
|
||||
public void Example()
|
||||
{
|
||||
Type = JsonSchemaType.Object
|
||||
};
|
||||
#region Usage
|
||||
JsonSchema schema = new JsonSchema
|
||||
{
|
||||
Type = JsonSchemaType.Object
|
||||
};
|
||||
|
||||
// serialize JsonSchema to a string and then write string to a file
|
||||
File.WriteAllText(@"c:\schema.json", schema.ToString());
|
||||
// serialize JsonSchema to a string and then write string to a file
|
||||
File.WriteAllText(@"c:\schema.json", schema.ToString());
|
||||
|
||||
// serialize JsonSchema directly to a file
|
||||
using (StreamWriter file = File.CreateText(@"c:\schema.json"))
|
||||
using (JsonTextWriter writer = new JsonTextWriter(file))
|
||||
{
|
||||
schema.WriteTo(writer);
|
||||
}
|
||||
#endregion
|
||||
// serialize JsonSchema directly to a file
|
||||
using (StreamWriter file = File.CreateText(@"c:\schema.json"))
|
||||
using (JsonTextWriter writer = new JsonTextWriter(file))
|
||||
{
|
||||
schema.WriteTo(writer);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user