This repository has been archived by the owner on Sep 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Showing
114 changed files
with
5,224 additions
and
3,453 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
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,3 @@ | ||
using System; | ||
|
||
using Newtonsoft.Json; | ||
|
||
namespace ModIO | ||
|
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,7 +1,6 @@ | ||
using System.Runtime.Serialization; | ||
|
||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Linq; | ||
|
||
namespace ModIO | ||
{ | ||
|
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,7 +1,6 @@ | ||
using System.Runtime.Serialization; | ||
|
||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Linq; | ||
|
||
namespace ModIO | ||
{ | ||
|
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,7 +1,6 @@ | ||
using System.Runtime.Serialization; | ||
|
||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Linq; | ||
|
||
namespace ModIO | ||
{ | ||
|
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,7 +1,6 @@ | ||
using System.Runtime.Serialization; | ||
|
||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Linq; | ||
|
||
namespace ModIO | ||
{ | ||
|
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,81 @@ | ||
using System.Runtime.Serialization; | ||
using System.Collections.Generic; | ||
|
||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Linq; | ||
|
||
namespace ModIO | ||
{ | ||
/// <summary>Terms of Use Object returned by the API.</summary> | ||
[System.Serializable] | ||
public class TermsOfUseInfo | ||
{ | ||
// ---------[ NESTED DATA-TYPES ]--------- | ||
/// <summary>Link data for further information.</summary> | ||
[System.Serializable] | ||
public struct LinkData | ||
{ | ||
/// <summary>Text to display on a button for the link.</summary> | ||
[JsonProperty("text")] | ||
public string buttonText; | ||
|
||
/// <summary>URL to the full information.</summary> | ||
[JsonProperty("url")] | ||
public string URL; | ||
|
||
/// <summary>Whether our terms require the URL to be made available to a user.</summary> | ||
[JsonProperty("required")] | ||
public bool required; | ||
} | ||
|
||
// ---------[ FIELDS ]--------- | ||
/// <summary>Terms of use the user needs to agree to in order to authenticate.</summary> | ||
[JsonProperty("plaintext")] | ||
public string terms; | ||
|
||
/// <summary>Terms of use the user needs to agree to in order to authenticate. (HTML)</summary> | ||
[JsonProperty("html")] | ||
public string terms_HTML; | ||
|
||
/// <summary>UI Text for the "agree" button.</summary> | ||
[JsonProperty("buttons.agree.text")] | ||
public string buttonText_agree; | ||
|
||
/// <summary>UI Text for the "disagree" button.</summary> | ||
[JsonProperty("buttons.disagree.text")] | ||
public string buttonText_disagree; | ||
|
||
/// <summary>Additional information URLs to be provided to the user.</summary> | ||
[JsonProperty("links")] | ||
public Dictionary<string, LinkData> links; | ||
|
||
// ---------[ API DESERIALIZATION ]--------- | ||
private const string APIOBJECT_LINKKEY_WEBSITE = "website"; | ||
private const string APIOBJECT_LINKKEY_TERMS = "terms"; | ||
private const string APIOBJECT_LINKKEY_PRIVACY = "privacy"; | ||
private const string APIOBJECT_LINKKEY_ACCOUNT = "manage"; | ||
|
||
private struct ButtonInfo | ||
{ | ||
public string text; | ||
} | ||
|
||
[JsonExtensionData] | ||
private IDictionary<string, JToken> m_extensionData; | ||
|
||
[OnDeserialized] | ||
private void OnDeserialized(StreamingContext context) | ||
{ | ||
if(this.m_extensionData != null | ||
&& this.m_extensionData.Count > 0) | ||
{ | ||
JToken infoToken; | ||
if(this.m_extensionData.TryGetValue("buttons", out infoToken)) | ||
{ | ||
this.buttonText_agree = (string)infoToken["agree"]["text"]; | ||
this.buttonText_disagree = (string)infoToken["disagree"]["text"]; | ||
} | ||
} | ||
} | ||
} | ||
} |
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,7 +1,6 @@ | ||
using System.Runtime.Serialization; | ||
|
||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Linq; | ||
|
||
namespace ModIO | ||
{ | ||
|
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
Oops, something went wrong.