private static PropertyInfo GetProperty(Module context, Type type, string name, Type propertyType)
{
Type org = type;
for (; type != null && !type.__IsMissing; type = type.BaseType)
{
foreach (PropertyInfo property in type.__GetDeclaredProperties())
{
if (property.IsPublic && !property.IsStatic && property.Name == name)
{
return property;
}
}
}
// if the property is missing, we stick the missing property on the first missing base type
if (type == null)
{
type = org;
}
return type.Module.universe.GetMissingPropertyOrThrow(context, type, name,
PropertySignature.Create(CallingConventions.Standard | CallingConventions.HasThis, propertyType, null, new PackedCustomModifiers()));
}