-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from ricaun-io/develop
Version 1.6.0
- Loading branch information
Showing
34 changed files
with
583 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<Version>1.5.0</Version> | ||
<Version>1.6.0</Version> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace ricaun.RevitTest.Command.Extensions.Json | ||
{ | ||
/// <summary> | ||
/// Represents a service for JSON serialization and deserialization. | ||
/// </summary> | ||
public interface IJsonService | ||
{ | ||
/// <summary> | ||
/// Deserializes the specified JSON string into an object of type T. | ||
/// </summary> | ||
/// <typeparam name="T">The type of the object to deserialize.</typeparam> | ||
/// <param name="value">The JSON string to deserialize.</param> | ||
/// <returns>The deserialized object of type T.</returns> | ||
T Deserialize<T>(string value); | ||
|
||
/// <summary> | ||
/// Serializes the specified object into a JSON string. | ||
/// </summary> | ||
/// <param name="value">The object to serialize.</param> | ||
/// <returns>The JSON string representation of the serialized object.</returns> | ||
string Serialize(object value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
namespace ricaun.RevitTest.Command.Extensions.Json | ||
{ | ||
#if NETFRAMEWORK | ||
using System.Web.Script.Serialization; | ||
internal class JsonService : IJsonService | ||
{ | ||
public JsonService() | ||
{ | ||
JavaScriptSerializer = new JavaScriptSerializer(); | ||
} | ||
public JavaScriptSerializer JavaScriptSerializer { get; set; } | ||
public T Deserialize<T>(string value) | ||
{ | ||
return JavaScriptSerializer.Deserialize<T>(value); | ||
} | ||
|
||
public string Serialize(object value) | ||
{ | ||
return JavaScriptSerializer.Serialize(value); | ||
} | ||
} | ||
#endif | ||
#if NET | ||
using System.Text.Json; | ||
internal class JsonService : IJsonService | ||
{ | ||
public T Deserialize<T>(string value) | ||
{ | ||
return JsonSerializer.Deserialize<T>(value); | ||
} | ||
|
||
public string Serialize(object value) | ||
{ | ||
return JsonSerializer.Serialize(value); | ||
} | ||
} | ||
#endif | ||
#if NETSTANDARD | ||
internal class JsonService : NewtonsoftJsonService | ||
{ | ||
} | ||
#endif | ||
} |
20 changes: 20 additions & 0 deletions
20
ricaun.RevitTest.Command/Extensions/Json/NewtonsoftJsonService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
namespace ricaun.RevitTest.Command.Extensions.Json | ||
{ | ||
internal class NewtonsoftJsonService : IJsonService | ||
{ | ||
public NewtonsoftJsonService() | ||
{ | ||
Settings = new Newtonsoft.Json.JsonSerializerSettings(); | ||
} | ||
public Newtonsoft.Json.JsonSerializerSettings Settings { get; } | ||
public T Deserialize<T>(string value) | ||
{ | ||
return Newtonsoft.Json.JsonConvert.DeserializeObject<T>(value, Settings); | ||
} | ||
|
||
public string Serialize(object value) | ||
{ | ||
return Newtonsoft.Json.JsonConvert.SerializeObject(value, Settings); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+3.23 KB
(100%)
ricaun.RevitTest.Console/Resources/ricaun.RevitTest.Application.bundle.zip
Binary file not shown.
Oops, something went wrong.