From 46578cb3e295fb23c3fb7ee8e06a40626751a0f6 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Fri, 27 Mar 2020 09:23:40 -0600 Subject: [PATCH] Updates constructor dictionary building & removes unneccesary usings --- .../AppServer/SIMPLJoinMaps/SIMPLAtcJoinMap.cs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/PepperDashEssentials/AppServer/SIMPLJoinMaps/SIMPLAtcJoinMap.cs b/PepperDashEssentials/AppServer/SIMPLJoinMaps/SIMPLAtcJoinMap.cs index e13c3b06..7db70a35 100644 --- a/PepperDashEssentials/AppServer/SIMPLJoinMaps/SIMPLAtcJoinMap.cs +++ b/PepperDashEssentials/AppServer/SIMPLJoinMaps/SIMPLAtcJoinMap.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; +using System.Linq; using Crestron.SimplSharp.Reflection; using PepperDash.Essentials.Core; @@ -58,16 +54,12 @@ namespace PepperDash.Essentials.AppServer public SIMPLAtcJoinMap() { // Add all the JoinDataComplete properties to the Joins Dictionary - GetType() + Joins = GetType() .GetCType() .GetProperties() - .Where(x => x.PropertyType == typeof(uint)) - .ToList() - .ForEach(prop => - { - var join = (JoinDataComplete)prop.GetValue(this, null); - Joins.Add(join.GetNameAttribute(), join); - }); + .Where(prop => prop.IsDefined(typeof (JoinNameAttribute), false)) + .Select(prop => (JoinDataComplete) prop.GetValue(this, null)) + .ToDictionary(join => join.GetNameAttribute(), join => join); } public override void OffsetJoinNumbers(uint joinStart)