Exemplo n.º 1
0
 private void RegisterAppendAttributeCodefix <AttributeType>(
     CodeFixContext context,
     string title,
     string equivalenceKey,
     Diagnostic diagnostic,
     EnumMemberDeclarationSyntax offendingFieldDeclaration,
     SemanticModel model) where AttributeType : Attribute
 {
     context.RegisterCodeFix(
         CodeAction.Create(
             title: title,
             createChangedSolution: c => AppendAttributeAsync(
                 context.Document,
                 offendingFieldDeclaration,
                 AttributeUtility.GetAttributeName <AttributeType>(),
                 AttributeUtility.GetAttributeNamespace <AttributeType>(),
                 c),
             equivalenceKey: equivalenceKey),
         diagnostic);
 }