internal static void CheckCustomAttributes(Cecil.ICustomAttributeProvider type,
out DebuggerBrowsableState? browsable_state,
out DebuggerDisplayAttribute debugger_display,
out DebuggerTypeProxyAttribute type_proxy,
out bool is_compiler_generated)
{
browsable_state = null;
debugger_display = null;
type_proxy = null;
is_compiler_generated = false;
foreach (Cecil.CustomAttribute cattr in type.CustomAttributes) {
string cname = cattr.Constructor.DeclaringType.FullName;
if (cname == cgen_attr) {
is_compiler_generated = true;
} else if (cname == debugger_display_attr) {
string text = (string) cattr.ConstructorParameters [0];
debugger_display = new DebuggerDisplayAttribute (text);
foreach (DictionaryEntry prop in cattr.Properties) {
string key = (string) prop.Key;
if (key == "Name")
debugger_display.Name = (string) prop.Value;
else if (key == "Type")
debugger_display.Type = (string) prop.Value;
else {
debugger_display = null;
break;
}
}
} else if (cname == browsable_attr) {
browsable_state = (DebuggerBrowsableState) cattr.Blob [2];
} else if (cname == type_proxy_attr) {
string text = (string) cattr.ConstructorParameters [0];
type_proxy = new DebuggerTypeProxyAttribute (text);
}
}
}