mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
Fixed build, made Box API V2 work with .NET3.5 unfortunately this means people with .NET 2.0 can't use the box plugin anymore.
This commit is contained in:
parent
5e10243eb3
commit
ba0c9d0010
5 changed files with 15 additions and 34 deletions
|
@ -216,23 +216,5 @@ namespace GreenshotBoxPlugin {
|
|||
return (T)deserializer.ReadObject(stream);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to parse JSON to object
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="jsonString"></param>
|
||||
/// <returns></returns>
|
||||
public static T DeserializeWithDirectory<T>(string jsonString) {
|
||||
DataContractJsonSerializerSettings settings = new DataContractJsonSerializerSettings();
|
||||
settings.UseSimpleDictionaryFormat = true;
|
||||
var deserializer = new DataContractJsonSerializer(typeof(T), settings);
|
||||
using (MemoryStream stream = new MemoryStream()) {
|
||||
byte[] content = Encoding.UTF8.GetBytes(jsonString);
|
||||
stream.Write(content, 0, content.Length);
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
return (T)deserializer.ReadObject(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue