mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-28 11:54:57 +00:00
25 lines
736 B
C#
25 lines
736 B
C#
using System.Collections.Generic;
|
|
using PepperDash.Core;
|
|
using PepperDash.Essentials.Core.Config;
|
|
|
|
namespace PepperDash.Essentials.Core.Web
|
|
{
|
|
public class EssentialsWebApiFactory : EssentialsDeviceFactory<EssentialsWebApi>
|
|
{
|
|
public EssentialsWebApiFactory()
|
|
{
|
|
TypeNames = new List<string> { "EssentialsWebApi" };
|
|
}
|
|
|
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
|
{
|
|
Debug.Console(1, "Factory Attempting to create new Essentials Web API Server");
|
|
|
|
var props = dc.Properties.ToObject<EssentialsWebApiPropertiesConfig>();
|
|
if (props != null) return new EssentialsWebApi(dc.Key, dc.Name, props);
|
|
|
|
Debug.Console(1, "Factory failed to create new Essentials Web API Server");
|
|
return null;
|
|
}
|
|
}
|
|
} |