// Get the custom attributes of a specific type that are // attached to a program item. public static Object[] GetCustomAttributes (IClrProgramItem item, Type type, bool inherit) { return GetCustomAttributes(item.ClrHandle, TypeToClrHandle(type, "type"), inherit); }
// Get a ParameterInfo block for a specific method parameter. // Zero indicates the return type. public static ParameterInfo GetParameterInfo(MemberInfo member, IClrProgramItem item, int num) { IntPtr param; Type type; param = GetParameter(item.ClrHandle, num); type = GetParameterType(item.ClrHandle, num); return new ClrParameter(member, param, num, type); }
// Get the name that is associated with a program item. public static String GetName(IClrProgramItem item) { return GetName(item.ClrHandle); }
// Get the declaring type for a program item. public static Type GetDeclaringType(IClrProgramItem item) { return Type.GetTypeFromHandle (new RuntimeTypeHandle(GetDeclaringType(item.ClrHandle))); }
// Determine if there are custom attributes of a specified // type attached to a program item. public static bool IsDefined(IClrProgramItem item, Type type, bool inherit) { return IsDefined(item.ClrHandle, TypeToClrHandle(type, "type"), inherit); }
/////////////////////////////////////////////////////////////////// // // Useful wrappers // /////////////////////////////////////////////////////////////////// // Get all custom attributes attached to a program item. public static Object[] GetCustomAttributes (IClrProgramItem item, bool inherit) { return GetCustomAttributes(item.ClrHandle, IntPtr.Zero, inherit); }
internal void AddDeclarativeSecurity(IClrProgramItem item, SecurityAction action, PermissionSet pset) { throw new NotImplementedException("AddDeclarativeSecurity"); }
internal void SetCustomAttribute (IClrProgramItem item, ConstructorInfo con, byte[] binaryAttribute) { throw new NotImplementedException("SetCustomAttribute"); }
// SetCustomAttribute(): // All other XXXBuilder classes invoke call the public method // AssemblyBuilder.SetCustomAttribute(), which invokes one of the // internal SetCustomAttribute() methods that follow. // Set custom attributes on a program item in this assembly. internal void SetCustomAttribute (IClrProgramItem item, CustomAttributeBuilder customBuilder) { byte[] blob = customBuilder.ToBytes(); IntPtr attribute = ClrAttributeCreate (base.privateData, ((IClrProgramItem)(customBuilder.con)).ClrHandle, blob); ClrAttributeAddToItem(item.ClrHandle, attribute); }