aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.ApiInteraction.Metro/DataSerializer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.ApiInteraction.Metro/DataSerializer.cs')
-rw-r--r--MediaBrowser.ApiInteraction.Metro/DataSerializer.cs28
1 files changed, 18 insertions, 10 deletions
diff --git a/MediaBrowser.ApiInteraction.Metro/DataSerializer.cs b/MediaBrowser.ApiInteraction.Metro/DataSerializer.cs
index 452ca43f4..8af88014c 100644
--- a/MediaBrowser.ApiInteraction.Metro/DataSerializer.cs
+++ b/MediaBrowser.ApiInteraction.Metro/DataSerializer.cs
@@ -13,18 +13,22 @@ namespace MediaBrowser.ApiInteraction
{
return Serializer.Deserialize<T>(stream);
}
- if (format == ApiInteraction.SerializationFormats.Jsv)
+ else if (format == ApiInteraction.SerializationFormats.Jsv)
{
throw new NotImplementedException();
}
-
- using (StreamReader streamReader = new StreamReader(stream))
+ else if (format == ApiInteraction.SerializationFormats.Json)
{
- using (JsonReader jsonReader = new JsonTextReader(streamReader))
+ using (StreamReader streamReader = new StreamReader(stream))
{
- return JsonSerializer.Create(new JsonSerializerSettings()).Deserialize<T>(jsonReader);
+ using (JsonReader jsonReader = new JsonTextReader(streamReader))
+ {
+ return JsonSerializer.Create(new JsonSerializerSettings()).Deserialize<T>(jsonReader);
+ }
}
}
+
+ throw new NotImplementedException();
}
public static object DeserializeFromStream(Stream stream, SerializationFormats format, Type type)
@@ -33,18 +37,22 @@ namespace MediaBrowser.ApiInteraction
{
throw new NotImplementedException();
}
- if (format == ApiInteraction.SerializationFormats.Jsv)
+ else if (format == ApiInteraction.SerializationFormats.Jsv)
{
throw new NotImplementedException();
}
-
- using (StreamReader streamReader = new StreamReader(stream))
+ else if (format == ApiInteraction.SerializationFormats.Json)
{
- using (JsonReader jsonReader = new JsonTextReader(streamReader))
+ using (StreamReader streamReader = new StreamReader(stream))
{
- return JsonSerializer.Create(new JsonSerializerSettings()).Deserialize(jsonReader, type);
+ using (JsonReader jsonReader = new JsonTextReader(streamReader))
+ {
+ return JsonSerializer.Create(new JsonSerializerSettings()).Deserialize(jsonReader, type);
+ }
}
}
+
+ throw new NotImplementedException();
}
public static void Configure()