mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-29 04:15:00 +00:00
41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
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
|
|
{
|
|
/// <summary>
|
|
/// Represents a MobileControlDeviceFactory
|
|
/// </summary>
|
|
public class MobileControlDeviceFactory : EssentialsDeviceFactory<MobileControlSystemController>
|
|
{
|
|
public MobileControlDeviceFactory()
|
|
{
|
|
TypeNames = new List<string> { "appserver", "mobilecontrol", "webserver" };
|
|
}
|
|
|
|
/// <summary>
|
|
/// BuildDevice method
|
|
/// </summary>
|
|
/// <inheritdoc />
|
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
|
{
|
|
try
|
|
{
|
|
var props = dc.Properties.ToObject<MobileControlConfig>();
|
|
return new MobileControlSystemController(dc.Key, dc.Name, props);
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Debug.LogMessage(e, "Error building Mobile Control System Controller");
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
} |