private static void ProcessT4Local(string id, MemberDeclarationSyntax memberNode, ClassDeclarationSyntax classNode, GeneratorExecutionContext context, T4Processor t4Processor, HashSet <string> alreadyProcessedT4, StringBuilder sb) { if (memberNode.AttributeLists == null) { return; } foreach (AttributeSyntax t4Attr in memberNode.GetAttributesOfType(Consts.ApplyT4Attributes)) { if (!t4Attr.HasAttributeParameter(Consts.T4TemplateScopeEnums, "Local")) { continue; } context.CancellationToken.ThrowIfCancellationRequested(); if (t4Attr.ArgumentList != null && t4Attr.ArgumentList.Arguments.Count > 0) { string templateName = t4Attr.ArgumentList.Arguments[0].ToString().Trim('\"'); string processedName = (classNode.SyntaxTree.FilePath + "::" + id + "::" + templateName).ToLower(); // apply to the source only once if (alreadyProcessedT4.Contains(processedName)) { continue; } t4Processor.ProcessTemplate(context, t4Attr, classNode, sb); alreadyProcessedT4.Add(processedName); } } }