added extension.js, trying to add legacy sprites for tree icons, updates tree icon filters (still not working)

This commit is contained in:
Shannon Deminick
2013-06-02 20:34:06 -10:00
parent 4a24abca17
commit dd3490a2ab
13 changed files with 636 additions and 25 deletions

View File

@@ -0,0 +1,33 @@
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Umbraco.Core.Serialization
{
/// <summary>
/// This is used in order to deserialize a json object on a property into a json string since the property's type is 'string'
/// </summary>
internal class JsonToStringConverter : 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)
{
if (reader.ValueType == typeof(string))
{
return reader.Value;
}
// Load JObject from stream
JObject jObject = JObject.Load(reader);
return jObject.ToString();
}
public override bool CanConvert(Type objectType)
{
return typeof(string).IsAssignableFrom(objectType);
}
}
}