Exemplo n.º 1
0
        // 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);
        }
	// 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);
			}