using PepperDash.Core;
using PepperDash.Core.Logging;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using Serilog.Events;
using System;
using System.Collections.Generic;
using System.Linq;
namespace PepperDash.Essentials
{
///
/// Represents a MobileControlDeviceFactory
///
public class MobileControlDeviceFactory : EssentialsDeviceFactory
{
public MobileControlDeviceFactory()
{
TypeNames = new List { "appserver", "mobilecontrol", "webserver" };
}
///
/// BuildDevice method
///
///
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
try
{
var props = dc.Properties.ToObject();
return new MobileControlSystemController(dc.Key, dc.Name, props);
}
catch (Exception e)
{
Debug.LogMessage(e, "Error building Mobile Control System Controller");
return null;
}
}
}
}