wasSharp

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 36  →  ?path2? @ 37
/Reflection.cs
@@ -144,21 +144,27 @@
var f = typeof(T).GetRuntimeFields();
var p = typeof(T).GetRuntimeProperties();
 
dynamic r = null;
 
if (f != null)
r = f.AsParallel()
{
var r = f.AsParallel()
.SelectMany(o => o.GetCustomAttributes(typeof(NameAttribute), false),
(o, a) => new { Field = o, Att = a })
.SingleOrDefault(q => q.Field.GetValue(structure).Equals(item));
if (r != null)
return ((NameAttribute)r.Att).Name;
}
 
if (p != null)
r = p.AsParallel()
{
var r = p.AsParallel()
.SelectMany(o => o.GetCustomAttributes(typeof(NameAttribute), false),
(o, a) => new { Property = o, Att = a })
.SingleOrDefault(q => q.Property.GetValue(structure).Equals(item));
if (r != null)
return ((NameAttribute)r.Att).Name;
}
 
return r != null ? ((NameAttribute)r.Att).Name : string.Empty;
return string.Empty;
}
 
///////////////////////////////////////////////////////////////////////////