-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Antonio Zhu
committed
Dec 14, 2022
1 parent
a02cdcc
commit 0a51e8d
Showing
18 changed files
with
388 additions
and
35 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/Portability/Rocket.Chat.Net.Portability.Android/Resources/Resource.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,6 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> | ||
</startup> | ||
<runtime> | ||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<dependentAssembly> | ||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" /> | ||
</dependentAssembly> | ||
<dependentAssembly> | ||
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-5.0.0.1" newVersion="5.0.0.1" /> | ||
</dependentAssembly> | ||
</assemblyBinding> | ||
</runtime> | ||
</configuration> |
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 |
---|---|---|
@@ -1,25 +1,34 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Microsoft.Bcl.AsyncInterfaces" version="5.0.0" targetFramework="net48" /> | ||
<package id="Microsoft.Net.Compilers" version="1.2.2" targetFramework="net45" developmentDependency="true" /> | ||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net48" /> | ||
<package id="NLog" version="5.1.0" targetFramework="net48" /> | ||
<package id="RestSharp" version="105.2.3" targetFramework="net45" /> | ||
<package id="RestSharp" version="108.0.3" targetFramework="net48" /> | ||
<package id="SuperSocket.ClientEngine.Core" version="0.10.0" targetFramework="net48" /> | ||
<package id="System.Buffers" version="4.5.1" targetFramework="net48" /> | ||
<package id="System.Collections.Specialized" version="4.3.0" targetFramework="net48" /> | ||
<package id="System.IO" version="4.3.0" targetFramework="net48" /> | ||
<package id="System.Linq" version="4.3.0" targetFramework="net48" /> | ||
<package id="System.Memory" version="4.5.4" targetFramework="net48" /> | ||
<package id="System.Net.NameResolution" version="4.3.0" targetFramework="net48" /> | ||
<package id="System.Net.Security" version="4.3.0" targetFramework="net48" /> | ||
<package id="System.Net.Sockets" version="4.3.0" targetFramework="net48" /> | ||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net48" /> | ||
<package id="System.Runtime" version="4.3.0" targetFramework="net48" /> | ||
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net48" /> | ||
<package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net48" /> | ||
<package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net48" /> | ||
<package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net48" /> | ||
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net48" /> | ||
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net48" /> | ||
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net48" /> | ||
<package id="System.Text.Encodings.Web" version="5.0.0" targetFramework="net48" /> | ||
<package id="System.Text.Json" version="5.0.1" targetFramework="net48" /> | ||
<package id="System.Text.RegularExpressions" version="4.3.0" targetFramework="net48" /> | ||
<package id="System.Threading" version="4.3.0" targetFramework="net48" /> | ||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net48" /> | ||
<package id="System.Threading.Timer" version="4.3.0" targetFramework="net48" /> | ||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net48" /> | ||
<package id="WebSocket4Net" version="0.15.2" targetFramework="net48" /> | ||
</packages> |
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,39 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Rocket.Chat.Net.JsonConverters | ||
{ | ||
public class RestApiConverter : JsonConverter | ||
{ | ||
public override bool CanConvert(Type objectType) | ||
{ | ||
if (objectType == typeof(string)) | ||
return true; | ||
else | ||
return false; | ||
} | ||
|
||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) | ||
{ | ||
var value = reader.Value; | ||
if (value == null || String.IsNullOrWhiteSpace(value.ToString())) | ||
{ | ||
return false; | ||
} | ||
|
||
if ("success".Equals(value.ToString(), StringComparison.OrdinalIgnoreCase)) | ||
{ | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
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,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Rocket.Chat.Net.Models.RestResults | ||
{ | ||
public class RestLoginResult | ||
{ | ||
|
||
public string UserId { get; set; } | ||
|
||
public string AuthToken { get; set; } | ||
|
||
public User Me { get; set; } | ||
|
||
} | ||
} |
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,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
using Newtonsoft.Json; | ||
using Rocket.Chat.Net.JsonConverters; | ||
|
||
namespace Rocket.Chat.Net.Models.RestResults | ||
{ | ||
public class RestResult | ||
{ | ||
[JsonProperty(PropertyName = "_id")] | ||
public string Id { get; set; } | ||
|
||
[JsonConverter(typeof(RestApiConverter))] | ||
public bool Success { get; set; } | ||
|
||
public string Error { get; set; } | ||
} | ||
|
||
public class RestResult<T> : RestResult | ||
{ | ||
public T Data { get; set; } | ||
} | ||
} |
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
Oops, something went wrong.