CSharpSourceEmitter.SourceEmitter.PrintTypeDefinitionAttributes C# (CSharp) Method

PrintTypeDefinitionAttributes() public method

public PrintTypeDefinitionAttributes ( ITypeDefinition typeDefinition ) : void
typeDefinition ITypeDefinition
return void
    public virtual void PrintTypeDefinitionAttributes(ITypeDefinition typeDefinition) {

      foreach (var attribute in SortAttributes(typeDefinition.Attributes)) {
        // Skip DefaultMemberAttribute on a class that has an indexer
        var at = Utils.GetAttributeType(attribute);
        if (at == SpecialAttribute.DefaultMemberAttribute &&
          IteratorHelper.Any(typeDefinition.Properties, p => IteratorHelper.EnumerableIsNotEmpty(p.Parameters)))
          continue;
        // Skip ExtensionAttribute
        if (at == SpecialAttribute.Extension)
          continue;

        PrintAttribute(typeDefinition, attribute, true, null);
      }

      if (typeDefinition.Layout != LayoutKind.Auto) {
        PrintPseudoCustomAttribute(typeDefinition,
          "System.Runtime.InteropServices.StructLayout",
          String.Format("System.Runtime.InteropServices.LayoutKind.{0}", typeDefinition.Layout.ToString()),
          true, null);
      }
    }
SourceEmitter