diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-10-28 19:17:55 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-10-28 19:17:55 -0400 |
| commit | 5ca4d60c34c7ead76c388bd2c3ca192b38aae1f0 (patch) | |
| tree | 9e9bc711c6b422c7f3eabdac5cd3cf2a8e5a11b8 /MediaBrowser.Model/ApiClient | |
| parent | 67528a07992326472a4e6dfe826ddcc5358a6f67 (diff) | |
connect updates
Diffstat (limited to 'MediaBrowser.Model/ApiClient')
| -rw-r--r-- | MediaBrowser.Model/ApiClient/ApiHelpers.cs | 22 | ||||
| -rw-r--r-- | MediaBrowser.Model/ApiClient/ConnectionState.cs | 3 | ||||
| -rw-r--r-- | MediaBrowser.Model/ApiClient/HttpResponseEventArgs.cs | 11 | ||||
| -rw-r--r-- | MediaBrowser.Model/ApiClient/IApiClient.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Model/ApiClient/RemoteLogoutReason.cs | 9 |
5 files changed, 45 insertions, 2 deletions
diff --git a/MediaBrowser.Model/ApiClient/ApiHelpers.cs b/MediaBrowser.Model/ApiClient/ApiHelpers.cs new file mode 100644 index 000000000..65b6495ab --- /dev/null +++ b/MediaBrowser.Model/ApiClient/ApiHelpers.cs @@ -0,0 +1,22 @@ +using System; + +namespace MediaBrowser.Model.ApiClient +{ + public static class ApiHelpers + { + /// <summary> + /// Gets the name of the slug. + /// </summary> + /// <param name="name">The name.</param> + /// <returns>System.String.</returns> + public static string GetSlugName(string name) + { + if (string.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + + return name.Replace('/', '-').Replace('?', '-').Replace('&', '-'); + } + } +} diff --git a/MediaBrowser.Model/ApiClient/ConnectionState.cs b/MediaBrowser.Model/ApiClient/ConnectionState.cs index 63e156eb1..5e47d688e 100644 --- a/MediaBrowser.Model/ApiClient/ConnectionState.cs +++ b/MediaBrowser.Model/ApiClient/ConnectionState.cs @@ -5,6 +5,7 @@ namespace MediaBrowser.Model.ApiClient Unavailable = 1, ServerSignIn = 2, SignedIn = 3, - ServerSelection = 4 + ServerSelection = 4, + ConnectSignIn = 5 } }
\ No newline at end of file diff --git a/MediaBrowser.Model/ApiClient/HttpResponseEventArgs.cs b/MediaBrowser.Model/ApiClient/HttpResponseEventArgs.cs index 417db404f..b1c19f056 100644 --- a/MediaBrowser.Model/ApiClient/HttpResponseEventArgs.cs +++ b/MediaBrowser.Model/ApiClient/HttpResponseEventArgs.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Net; namespace MediaBrowser.Model.ApiClient @@ -18,5 +19,15 @@ namespace MediaBrowser.Model.ApiClient /// </summary> /// <value>The status code.</value> public HttpStatusCode StatusCode { get; set; } + /// <summary> + /// Gets or sets the headers. + /// </summary> + /// <value>The headers.</value> + public Dictionary<string, string> Headers { get; set; } + + public HttpResponseEventArgs() + { + Headers = new Dictionary<string, string>(); + } } } diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs index bc909284b..89c731223 100644 --- a/MediaBrowser.Model/ApiClient/IApiClient.cs +++ b/MediaBrowser.Model/ApiClient/IApiClient.cs @@ -32,7 +32,7 @@ namespace MediaBrowser.Model.ApiClient /// <summary> /// Occurs when [remote logged out]. /// </summary> - event EventHandler<EventArgs> RemoteLoggedOut; + event EventHandler<GenericEventArgs<RemoteLogoutReason>> RemoteLoggedOut; /// <summary> /// Occurs when [authenticated]. diff --git a/MediaBrowser.Model/ApiClient/RemoteLogoutReason.cs b/MediaBrowser.Model/ApiClient/RemoteLogoutReason.cs new file mode 100644 index 000000000..237949c69 --- /dev/null +++ b/MediaBrowser.Model/ApiClient/RemoteLogoutReason.cs @@ -0,0 +1,9 @@ + +namespace MediaBrowser.Model.ApiClient +{ + public enum RemoteLogoutReason + { + GeneralAccesError = 0, + ParentalControlRestriction = 1 + } +} |
