internal int Count(DType /*!*/ attributeType, AST.CustomAttribute.TargetSelectors selector) { if (attributes == null) { return(0); } int count = 0; foreach (CustomAttribute attribute in attributes) { if (attribute.TargetSelector == selector && attribute.Type.Equals(attributeType)) { count++; } } return(count); }
public override void EmitCustomAttribute(CustomAttributeBuilder /*!*/ builder, AST.CustomAttribute.TargetSelectors selector) { switch (selector) { case AST.CustomAttribute.TargetSelectors.Assembly: RealAssemblyBuilder.SetCustomAttribute(builder); break; case AST.CustomAttribute.TargetSelectors.Module: RealModuleBuilder.SetCustomAttribute(builder); break; } }
public override void ApplyCustomAttribute(AST.SpecialAttributes kind, Attribute attribute, AST.CustomAttribute.TargetSelectors selector) { switch (kind) { case AST.SpecialAttributes.Export: this.exportInfo = (ExportAttribute)attribute; break; default: Debug.Fail("N/A"); break; } }
public override int GetAttributeUsageCount(DType /*!*/ type, AST.CustomAttribute.TargetSelectors selector) { return(attributes.Count(type, selector)); }
public override int GetAttributeUsageCount(DType type, AST.CustomAttribute.TargetSelectors selector) { Debug.Fail("Custom attributes cannot be defined on transient assemblies or modules."); throw null; }
public override void EmitCustomAttribute(CustomAttributeBuilder builder, AST.CustomAttribute.TargetSelectors selector) { Debug.Fail("Custom attributes cannot be defined on transient assemblies or modules."); throw null; }
public override void ApplyCustomAttribute(AST.SpecialAttributes kind, Attribute attribute, AST.CustomAttribute.TargetSelectors selector) { Debug.Fail("Custom attributes cannot be defined on transient assemblies or modules."); throw null; }
public abstract int GetAttributeUsageCount(DType type, AST.CustomAttribute.TargetSelectors selector);
public abstract void EmitCustomAttribute(CustomAttributeBuilder builder, AST.CustomAttribute.TargetSelectors selector);
public abstract void ApplyCustomAttribute(AST.SpecialAttributes kind, Attribute attribute, AST.CustomAttribute.TargetSelectors selector);