diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-01-23 14:34:55 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-01-23 14:34:55 +0200 |
| commit | 60a2692fd4acadfdf8724bb198e38a2689a866fd (patch) | |
| tree | e0924aa7d75c61875419dca7c31b338addd8661e /Software/Visual_Studio/Tango.Core/ExtensionMethods | |
| parent | 73433f297a3361511ba8ff99e2ff852e376987c5 (diff) | |
| download | Tango-60a2692fd4acadfdf8724bb198e38a2689a866fd.tar.gz Tango-60a2692fd4acadfdf8724bb198e38a2689a866fd.zip | |
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...
Diffstat (limited to 'Software/Visual_Studio/Tango.Core/ExtensionMethods')
| -rw-r--r-- | Software/Visual_Studio/Tango.Core/ExtensionMethods/IParameterizedExtensions.cs | 11 |
1 files changed, 9 insertions, 2 deletions
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<ParameterItemAttribute>().FirstOrDefault(); var ignore = prop.GetCustomAttributes(typeof(ParameterIgnoreAttribute), false).Cast<ParameterIgnoreAttribute>().FirstOrDefault(); + var indexAttr = prop.GetCustomAttributes(typeof(PropertyIndexAttribute), false).Cast<PropertyIndexAttribute>().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(); } /// <summary> @@ -119,6 +120,12 @@ public static class IParameterizedExtensions { item.StringFormat = formatAtt.Format; } + + PropertyIndexAttribute indexAtt = propertyInfo.GetCustomAttribute<PropertyIndexAttribute>(); + if (indexAtt != null) + { + item.Index = indexAtt.Index; + } } if (mode == ParameterItemMode.Event) |
