public override void RunInterface(string pluginName)
{
this.Log.Debug("Running interface");
pName = pluginName;
OSAEObjectTypeManager.ObjectTypeUpdate("XBMC SYSTEM", "XBMC SYSTEM", "XBMC System", pluginName, "XBMC SYSTEM", 0, 0, 0, 1);
OSAEObjectCollection XBMCInstances = OSAEObjectManager.GetObjectsByType("XBMC System");
foreach (OSAEObject obj in XBMCInstances)
{
string ip = "", username = "", password = "";
int port = 0;
foreach (OSAEObjectProperty p in obj.Properties)
{
switch (p.Name)
{
case "IP":
ip = p.Value;
break;
case "Port":
port = Int32.Parse(p.Value);
break;
case "Username":
username = p.Value;
break;
case "Password":
password = p.Value;
break;
}
}
this.Log.Debug("Creating new XBMC System connection: " + obj.Name + " - " + ip);
try
{
XBMCSystem system = new XBMCSystem(obj.Name, ip, port, username, password);
if (system.Connect())
{
Systems.Add(system);
}
}
catch (Exception ex)
{
this.Log.Error("Error connecting to XBMC system: " + ex.Message + " - " + ex.InnerException.Message);
}
}
Clock = new System.Timers.Timer();
Clock.Interval = 5000;
Clock.Elapsed += new ElapsedEventHandler(Timer_Tick);
Clock.Start();
}