public bool HasAccess(Type type)
{
if (type != null)
{
PropertyInfo[] allProps = type.GetProperties(BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public);
foreach (PropertyInfo prop in allProps)
{
CPA attr = Properties.GetCPA(prop);
if (attr != null && ((prop.CanRead && m_From.AccessLevel < attr.ReadLevel) || (prop.CanWrite && m_From.AccessLevel < attr.WriteLevel)))
{
m_From.SendMessage("The item {0} contains the property {1}, which you do not have access to.", type.Name, prop.Name);
return(false);
}
}
return(true);
}
return(false);
}