diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.CSV')
| -rw-r--r-- | Software/Visual_Studio/Tango.CSV/CsvFileReader.cs | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/Software/Visual_Studio/Tango.CSV/CsvFileReader.cs b/Software/Visual_Studio/Tango.CSV/CsvFileReader.cs index 79f716aab..c4e3e6d07 100644 --- a/Software/Visual_Studio/Tango.CSV/CsvFileReader.cs +++ b/Software/Visual_Studio/Tango.CSV/CsvFileReader.cs @@ -247,6 +247,15 @@ namespace Tango.CSV var flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.IgnoreCase | (staticMember ? BindingFlags.Static : BindingFlags.Instance); Action<T, string> action = null; + var propByIndex = typeof(T).GetProperties(flags).SingleOrDefault(x => x.GetCustomAttribute<CsvOrderAttribute>() != null && x.GetCustomAttribute<CsvOrderAttribute>().Index == index); + + if (propByIndex != null) + { + var pFunc = StringToObject(propByIndex.PropertyType); + action = EmitSetValueAction(propByIndex, pFunc); + return action; + } + PropertyInfo pi = typeof(T).GetProperty(c, flags); if (pi != null) { @@ -264,17 +273,6 @@ namespace Tango.CSV } } - if (action == null && index != null) - { - var propByIndex = typeof(T).GetProperties(flags).SingleOrDefault(x => x.GetCustomAttribute<CsvOrderAttribute>() != null && x.GetCustomAttribute<CsvOrderAttribute>().Index == index); - - if (propByIndex != null) - { - var pFunc = StringToObject(propByIndex.PropertyType); - action = EmitSetValueAction(propByIndex, pFunc); - } - } - return action; } |
