Files
Essentials/src/PepperDash.Essentials.Core/Crestron IO/Cards/InternalCardCageControllerFactory.cs
Nick Genovese f640f0f911 feature: updated folder structure
- moved files into folders to match their current namespace
- did not update any namespaces to maintain backward compatibility
2023-10-26 10:22:25 -04:00

32 lines
1.1 KiB
C#

using System.Collections.Generic;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core.CrestronIO.Cards
{
public class InternalCardCageControllerFactory : EssentialsDeviceFactory<InternalCardCageController>
{
public InternalCardCageControllerFactory()
{
TypeNames = new List<string> {"internalcardcage"};
}
#region Overrides of EssentialsDeviceFactory<InternalCardCageController>
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory attempting to build new Internal Card Cage Controller");
if (!Global.ControlSystem.SupportsThreeSeriesPlugInCards)
{
Debug.Console(0, Debug.ErrorLogLevel.Warning, "Current control system does NOT support 3-Series cards. Everything is NOT awesome.");
return null;
}
var config = dc.Properties.ToObject<InternalCardCageConfiguration>();
return new InternalCardCageController(dc.Key, dc.Name, config);
}
#endregion
}
}