Fixed syntax issue in CustomActivate()

This commit is contained in:
Neil Dorin
2019-11-19 20:08:47 -07:00
parent 11a01c707c
commit fa1b9595f7

View File

@@ -116,23 +116,25 @@ namespace PepperDash.Essentials.DM
public override bool CustomActivate() public override bool CustomActivate()
{ {
// Set input and output names from config // Set input and output names from config
if (InputNames != null) if (InputNames != null)
{
foreach (var kvp in InputNames) foreach (var kvp in InputNames)
{ {
var input = (Dmps.SwitcherInputs[kvp.Key] as DMInput); var input = (Dmps.SwitcherInputs[kvp.Key] as DMInput);
if(input != null) if (input != null)
input.Name.StringValue = kvp.Value; input.Name.StringValue = kvp.Value;
} }
}
if (OutputNames != null) if (OutputNames != null)
{
foreach (var kvp in OutputNames) foreach (var kvp in OutputNames)
{ {
var output = (Dmps.SwitcherOutputs[kvp.Key] as DMOutput); var output = (Dmps.SwitcherOutputs[kvp.Key] as DMOutput);
if(output != null) if (output != null)
output.Name.StringValue = kvp.Value; output.Name.StringValue = kvp.Value;
} }
}
// Subscribe to events // Subscribe to events
Dmps.DMInputChange += new DMInputEventHandler(Dmps_DMInputChange); Dmps.DMInputChange += new DMInputEventHandler(Dmps_DMInputChange);