public ClassDeclarationSyntax Update(ClassDeclarationSyntax @class) { _replace = RoslynCompiler.Track(@class.SyntaxTree, _replace); var result = @class .ReplaceNodes(_replace.Keys, (on, nn) => _replace[on]) .AddMembers(_add .Union(_types) .Select(add => (MemberDeclarationSyntax)RoslynCompiler.TrackNode(add)) .ToArray()); _add.Clear(); _types.Clear(); _replace.Clear(); //add markers result = addAttribute(result, "Concurrent", true); if (IsSingleton) { result = addAttribute(result, "ConcurrentSingleton", false); } return(result); }
public ClassDeclarationSyntax Update(ClassDeclarationSyntax @class) { _replace = RoslynCompiler.Track(@class.SyntaxTree, _replace); var result = @class .ReplaceNodes(_replace.Keys, (on, nn) => _replace[on]) .RemoveNodes(_remove, SyntaxRemoveOptions.KeepNoTrivia) .AddMembers(_add .Union(_types) .Select(add => (MemberDeclarationSyntax)RoslynCompiler.TrackNode(add)) .ToArray()); _remove.Clear(); _add.Clear(); _types.Clear(); _replace.Clear(); return(result); }