From 5ca4d60c34c7ead76c388bd2c3ca192b38aae1f0 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 28 Oct 2014 19:17:55 -0400 Subject: connect updates --- MediaBrowser.Model/ApiClient/ApiHelpers.cs | 22 ++++++++++++++++++++++ MediaBrowser.Model/ApiClient/ConnectionState.cs | 3 ++- .../ApiClient/HttpResponseEventArgs.cs | 11 +++++++++++ MediaBrowser.Model/ApiClient/IApiClient.cs | 2 +- MediaBrowser.Model/ApiClient/RemoteLogoutReason.cs | 9 +++++++++ 5 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 MediaBrowser.Model/ApiClient/ApiHelpers.cs create mode 100644 MediaBrowser.Model/ApiClient/RemoteLogoutReason.cs (limited to 'MediaBrowser.Model/ApiClient') diff --git a/MediaBrowser.Model/ApiClient/ApiHelpers.cs b/MediaBrowser.Model/ApiClient/ApiHelpers.cs new file mode 100644 index 0000000000..65b6495ab2 --- /dev/null +++ b/MediaBrowser.Model/ApiClient/ApiHelpers.cs @@ -0,0 +1,22 @@ +using System; + +namespace MediaBrowser.Model.ApiClient +{ + public static class ApiHelpers + { + /// + /// Gets the name of the slug. + /// + /// The name. + /// System.String. + 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 63e156eb1f..5e47d688e1 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 417db404fa..b1c19f0566 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 /// /// The status code. public HttpStatusCode StatusCode { get; set; } + /// + /// Gets or sets the headers. + /// + /// The headers. + public Dictionary Headers { get; set; } + + public HttpResponseEventArgs() + { + Headers = new Dictionary(); + } } } diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs index bc909284b3..89c7312238 100644 --- a/MediaBrowser.Model/ApiClient/IApiClient.cs +++ b/MediaBrowser.Model/ApiClient/IApiClient.cs @@ -32,7 +32,7 @@ namespace MediaBrowser.Model.ApiClient /// /// Occurs when [remote logged out]. /// - event EventHandler RemoteLoggedOut; + event EventHandler> RemoteLoggedOut; /// /// Occurs when [authenticated]. diff --git a/MediaBrowser.Model/ApiClient/RemoteLogoutReason.cs b/MediaBrowser.Model/ApiClient/RemoteLogoutReason.cs new file mode 100644 index 0000000000..237949c694 --- /dev/null +++ b/MediaBrowser.Model/ApiClient/RemoteLogoutReason.cs @@ -0,0 +1,9 @@ + +namespace MediaBrowser.Model.ApiClient +{ + public enum RemoteLogoutReason + { + GeneralAccesError = 0, + ParentalControlRestriction = 1 + } +} -- cgit v1.2.3