//----------------------------------------------------------------------------------------------------------------------------------------------------- public void Attribute <TAttribute>(Action <AttributeArgumentWriter <TAttribute> > values = null) where TAttribute : Attribute { var builder = new AttributeArgumentWriter <TAttribute>(values); m_OwnerEvent.EventBuilder.SetCustomAttribute(builder.GetAttributeBuilder()); }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public AttributeWriter Set <TAttribute>(Action <AttributeArgumentWriter <TAttribute> > arguments = null) where TAttribute : Attribute { var attribute = new AttributeArgumentWriter <TAttribute>(arguments); m_Attributes.Add(attribute); return(this); }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public ImplementationClassWriter <TBase> Attribute <TAttribute>(Action <AttributeArgumentWriter <TAttribute> > values = null) where TAttribute : Attribute { var writer = new AttributeArgumentWriter <TAttribute>(values); OwnerClass.TypeBuilder.SetCustomAttribute(writer.GetAttributeBuilder()); return(this); }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public void Attribute <TAttribute>(Action <AttributeArgumentWriter <TAttribute> > values = null) where TAttribute : Attribute { ValidateNotAnonymousMethod(); var builder = new AttributeArgumentWriter <TAttribute>(values); m_OwnerMethod.MethodFactory.SetAttribute(builder.GetAttributeBuilder()); }