CustomAttributeDataMirror[] GetCAttrs (TypeMirror type, bool inherit) {
// FIXME: Handle inherit
if (cattrs == null) {
CattrInfo[] info = vm.conn.Type_GetCustomAttributes (id, 0, false);
cattrs = CustomAttributeDataMirror.Create (vm, info);
}
var res = new List<CustomAttributeDataMirror> ();
foreach (var attr in cattrs)
if (type == null || attr.Constructor.DeclaringType == type)
res.Add (attr);
return res.ToArray ();
}