wasSharpNET

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 1  →  ?path2? @ HEAD
/Reflection.cs
@@ -31,12 +31,8 @@
{
if (fi.FieldType.FullName.Split('.', '+')
.Contains(@namespace, StringComparer.OrdinalIgnoreCase))
{
foreach (var sf in wasGetFields(fi.GetValue(@object), @namespace))
{
yield return sf;
}
}
yield return new KeyValuePair<FieldInfo, object>(fi, @object);
}
}
@@ -67,16 +63,12 @@
var array = (Array) getMethod.Invoke(@object, null);
foreach (var sp in
array.Cast<object>().SelectMany(element => wasGetProperties(element, @namespace)))
{
yield return sp;
}
}
foreach (
var sp in
wasGetProperties(pi.GetValue(@object, null), @namespace))
{
wasGetProperties(pi.GetValue(@object, null), @namespace))
yield return sp;
}
}
yield return new KeyValuePair<PropertyInfo, object>(pi, @object);
}
@@ -122,16 +114,12 @@
{
var fi = (object) info as FieldInfo;
if (fi != null)
{
return fi.GetValue(value);
}
var pi = (object) info as PropertyInfo;
if (pi != null)
{
if (pi.GetIndexParameters().Any())
{
return value;
}
return pi.GetValue(value, null);
}
return null;