From 60a2692fd4acadfdf8724bb198e38a2689a866fd Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Thu, 23 Jan 2020 14:34:55 +0200 Subject: Added new staple spun process parameters to database, BL and PMR. Implemented process params index via db. Added new process params in MS. Added JOB_RUN => Upload time, Heating Time, IsGradient... --- .../Tango.Core/ExtensionMethods/IParameterizedExtensions.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/Tango.Core/ExtensionMethods') diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/IParameterizedExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/IParameterizedExtensions.cs index 4850ccc25..c0490af8e 100644 --- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/IParameterizedExtensions.cs +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/IParameterizedExtensions.cs @@ -54,10 +54,11 @@ public static class IParameterizedExtensions { var paramAtt = prop.GetCustomAttributes(typeof(ParameterItemAttribute), false).Cast().FirstOrDefault(); var ignore = prop.GetCustomAttributes(typeof(ParameterIgnoreAttribute), false).Cast().FirstOrDefault(); + var indexAttr = prop.GetCustomAttributes(typeof(PropertyIndexAttribute), false).Cast().FirstOrDefault(); if (ignore == null && !properties.Exists(x => x.Name == prop.Name)) { - var item = instance.CreateParameterItem(prop, paramAtt, index++, mode); + var item = instance.CreateParameterItem(prop, paramAtt,indexAttr != null ? indexAttr.Index : index++, mode); ps.Add(item); properties.Add(prop); } @@ -65,7 +66,7 @@ public static class IParameterizedExtensions } } - return ps; + return ps.OrderBy(x => x.Index).ToObservableCollection(); } /// @@ -119,6 +120,12 @@ public static class IParameterizedExtensions { item.StringFormat = formatAtt.Format; } + + PropertyIndexAttribute indexAtt = propertyInfo.GetCustomAttribute(); + if (indexAtt != null) + { + item.Index = indexAtt.Index; + } } if (mode == ParameterItemMode.Event) -- cgit v1.3.1