wasSharpNET

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ HEAD  →  ?path2? @ 1
/Reflection.cs
@@ -31,8 +31,12 @@
{
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);
}
}
@@ -63,12 +67,16 @@
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);
}
@@ -114,12 +122,16 @@
{
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;