connect updates

This commit is contained in:
Luke Pulverenti
2014-10-28 19:17:55 -04:00
parent 67528a0799
commit 5ca4d60c34
30 changed files with 194 additions and 92 deletions

View File

@@ -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('&', '-');
}
}
}

View File

@@ -5,6 +5,7 @@ namespace MediaBrowser.Model.ApiClient
Unavailable = 1,
ServerSignIn = 2,
SignedIn = 3,
ServerSelection = 4
ServerSelection = 4,
ConnectSignIn = 5
}
}

View File

@@ -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>();
}
}
}

View File

@@ -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].

View File

@@ -0,0 +1,9 @@

namespace MediaBrowser.Model.ApiClient
{
public enum RemoteLogoutReason
{
GeneralAccesError = 0,
ParentalControlRestriction = 1
}
}

View File

@@ -60,6 +60,7 @@
<Link>Properties\SharedVersion.cs</Link>
</Compile>
<Compile Include="Activity\ActivityLogEntry.cs" />
<Compile Include="ApiClient\ApiHelpers.cs" />
<Compile Include="ApiClient\ConnectionMode.cs" />
<Compile Include="ApiClient\ConnectionResult.cs" />
<Compile Include="ApiClient\ConnectionState.cs" />
@@ -71,6 +72,7 @@
<Compile Include="ApiClient\IDevice.cs" />
<Compile Include="ApiClient\IServerEvents.cs" />
<Compile Include="ApiClient\GeneralCommandEventArgs.cs" />
<Compile Include="ApiClient\RemoteLogoutReason.cs" />
<Compile Include="ApiClient\ServerCredentials.cs" />
<Compile Include="ApiClient\ServerDiscoveryInfo.cs" />
<Compile Include="ApiClient\ServerInfo.cs" />