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:
parent
e36cc6578a
commit
64e3a4db59
4 changed files with 0 additions and 80 deletions
|
@ -3,7 +3,6 @@
|
|||
using Newtonsoft.Json;
|
||||
|
||||
using SBRL.Utilities;
|
||||
using SBRL.Utilities.JsonConverters;
|
||||
|
||||
namespace Nibriboard.Client.Messages
|
||||
{
|
||||
|
|
|
@ -77,8 +77,6 @@
|
|||
<Compile Include="Client\Messages\CursorPositionMessage.cs" />
|
||||
<Compile Include="Client\Messages\ClientStateMessage.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\Vector2.cs" />
|
||||
</ItemGroup>
|
||||
|
@ -94,7 +92,6 @@
|
|||
<Folder Include="ClientFiles\" />
|
||||
<Folder Include="Client\" />
|
||||
<Folder Include="Client\Messages\" />
|
||||
<Folder Include="Utilities\JsonConverters\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in a new issue