1
0
Fork 0
mirror of https://github.com/sbrl/Nibriboard.git synced 2018-01-10 21:33:49 +00:00

Remove old JsonConverters.

This commit is contained in:
Starbeamrainbowlabs 2017-02-05 17:27:46 +00:00
parent e36cc6578a
commit 64e3a4db59
4 changed files with 0 additions and 80 deletions

View file

@ -3,7 +3,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using SBRL.Utilities; using SBRL.Utilities;
using SBRL.Utilities.JsonConverters;
namespace Nibriboard.Client.Messages namespace Nibriboard.Client.Messages
{ {

View file

@ -77,8 +77,6 @@
<Compile Include="Client\Messages\CursorPositionMessage.cs" /> <Compile Include="Client\Messages\CursorPositionMessage.cs" />
<Compile Include="Client\Messages\ClientStateMessage.cs" /> <Compile Include="Client\Messages\ClientStateMessage.cs" />
<Compile Include="RippleSpace\ClientState.cs" /> <Compile Include="RippleSpace\ClientState.cs" />
<Compile Include="Utilities\JsonConverters\PointConverter.cs" />
<Compile Include="Utilities\JsonConverters\RectangleJsonConverter.cs" />
<Compile Include="Utilities\Rectangle.cs" /> <Compile Include="Utilities\Rectangle.cs" />
<Compile Include="Utilities\Vector2.cs" /> <Compile Include="Utilities\Vector2.cs" />
</ItemGroup> </ItemGroup>
@ -94,7 +92,6 @@
<Folder Include="ClientFiles\" /> <Folder Include="ClientFiles\" />
<Folder Include="Client\" /> <Folder Include="Client\" />
<Folder Include="Client\Messages\" /> <Folder Include="Client\Messages\" />
<Folder Include="Utilities\JsonConverters\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <None Include="packages.config" />

View file

@ -1,37 +0,0 @@
using System;
using System.Drawing;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace SBRL.Utilities.JsonConverters
{
/// <summary>
/// Deserialises objects into points from the System.Drawing namespace.
/// </summary>
public class PointConverter : JsonConverter
{
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
throw new NotImplementedException();
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
JObject jsonObject = JObject.Load(reader);
return new Point(
jsonObject.Value<int>("X"),
jsonObject.Value<int>("Y")
);
}
public override bool CanConvert(Type objectType)
{
if (objectType != typeof(Rectangle))
return false;
return true;
}
}
}

View file

@ -1,39 +0,0 @@
using System;
using System.Drawing;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace SBRL.Utilities.JsonConverters
{
/// <summary>
/// Deserialises objects into rectangles from the System.Drawing namespace.
/// </summary>
public class RectangleJsonConverter : JsonConverter
{
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
throw new NotImplementedException();
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
JObject jsonObject = JObject.Load(reader);
return new Rectangle(
jsonObject.Value<int>("X"),
jsonObject.Value<int>("Y"),
jsonObject.Value<int>("Width"),
jsonObject.Value<int>("Height")
);
}
public override bool CanConvert(Type objectType)
{
if (objectType != typeof(Rectangle))
return false;
return true;
}
}
}