-Code reformat

This commit is contained in:
James Newton-King
2013-10-20 15:08:39 +13:00
parent d03963016e
commit bcd6982419
466 changed files with 71645 additions and 71598 deletions
@@ -8,37 +8,37 @@ using Newtonsoft.Json.Linq;
namespace Newtonsoft.Json.Tests.Documentation.Samples.Bson
{
public class SerializeToBson
{
#region Types
public class Event
public class SerializeToBson
{
public string Name { get; set; }
public DateTime StartDate { get; set; }
}
#endregion
public void Example()
{
#region Usage
Event e = new Event
#region Types
public class Event
{
Name = "Movie Premiere",
StartDate = new DateTime(2013, 1, 22, 20, 30, 0)
};
public string Name { get; set; }
public DateTime StartDate { get; set; }
}
#endregion
MemoryStream ms = new MemoryStream();
using (BsonWriter writer = new BsonWriter(ms))
{
JsonSerializer serializer = new JsonSerializer();
serializer.Serialize(writer, e);
}
public void Example()
{
#region Usage
Event e = new Event
{
Name = "Movie Premiere",
StartDate = new DateTime(2013, 1, 22, 20, 30, 0)
};
string data = Convert.ToBase64String(ms.ToArray());
Console.WriteLine(data);
// MQAAAAJOYW1lAA8AAABNb3ZpZSBQcmVtaWVyZQAJU3RhcnREYXRlAMDgKWE8AQAAAA==
#endregion
MemoryStream ms = new MemoryStream();
using (BsonWriter writer = new BsonWriter(ms))
{
JsonSerializer serializer = new JsonSerializer();
serializer.Serialize(writer, e);
}
string data = Convert.ToBase64String(ms.ToArray());
Console.WriteLine(data);
// MQAAAAJOYW1lAA8AAABNb3ZpZSBQcmVtaWVyZQAJU3RhcnREYXRlAMDgKWE8AQAAAA==
#endregion
}
}
}
}