Added ApiPort and ServerHostName to ApiClient

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti 2012-08-01 15:09:24 -04:00
parent 00c22a3454
commit 80fd8d0156
2 changed files with 19 additions and 3 deletions

View file

@ -8,7 +8,23 @@ namespace MediaBrowser.ApiInteraction
/// </summary>
public abstract class BaseClient : IDisposable
{
public string ApiUrl { get; set; }
/// <summary>
/// Gets or sets the server host name (myserver or 192.168.x.x)
/// </summary>
public string ServerHostName { get; set; }
/// <summary>
/// Gets or sets the port number used by the API
/// </summary>
public int ApiPort { get; set; }
protected string ApiUrl
{
get
{
return string.Format("http://{0}:{1}/mediabrowser/api", ServerHostName, ApiPort);
}
}
protected HttpClient HttpClient { get; private set; }

View file

@ -214,7 +214,7 @@ namespace MediaBrowser.Common.Kernel
/// <summary>
/// Reloads application configuration from the config file
/// </summary>
private void ReloadConfiguration()
protected virtual void ReloadConfiguration()
{
// Deserialize config
if (!File.Exists(ConfigurationPath))
@ -270,7 +270,7 @@ namespace MediaBrowser.Common.Kernel
/// <summary>
/// Disposes all resources currently in use.
/// </summary>
public void Dispose()
public virtual void Dispose()
{
DisposeHttpServer();
DisposeLogger();