mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 14:03:23 -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>GreenshotBoxPlugin</RootNamespace>
|
||||
<AssemblyName>GreenshotBoxPlugin</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<NoStdLib>False</NoStdLib>
|
||||
|
@ -26,6 +26,7 @@
|
|||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.ServiceModel.Web" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BoxConfiguration.cs" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue