private static string Classes(SourceCodeFileDto sourceCodeFile) { return(string.Join( Environment.NewLine, sourceCodeFile.Classes.Select( classDeclarationInfo => GenerateClass(classDeclarationInfo, methodDeclarationInfo => GenerateMethod(methodDeclarationInfo, s => GenerateAttribute(s)))))); }
private SourceCodeFile ToSourceCodeFile(SourceCodeFileDto scf) { return(new SourceCodeFile( _ruleViolationFactory, scf.DeclaredNamespaces, scf.ParentProjectAssemblyName, scf.ParentProjectRootNamespace, scf.PathRelativeToProjectRoot, ToClasses(scf.Classes, methodDeclarationInfos => ToMethods(methodDeclarationInfos, _ruleViolationFactory)))); }
public static string GenerateFrom(SourceCodeFileDto sourceCodeFile) { return(Usings(sourceCodeFile) + $"namespace {sourceCodeFile.DeclaredNamespaces.Single()}" + " {" + Classes(sourceCodeFile) + "}"); }
private static string Usings(SourceCodeFileDto sourceCodeFile) { return(string.Join( Environment.NewLine, sourceCodeFile.Usings.Select(n => $"using {n};"))); }
public FileInfo PathToFileInProject(DirectoryName projectDirectoryName, SourceCodeFileDto sourceCodeFile) { var fullFilePath = _absoluteSolutionDirectoryPath + projectDirectoryName + sourceCodeFile.PathRelativeToProjectRoot; return(fullFilePath.Info()); }
public void AddFile(SourceCodeFileDto xmlSourceCodeFile) { _xmlProject.SourceCodeFiles.Add(xmlSourceCodeFile); }
public void Add(string projectName, SourceCodeFileDto xmlSourceCodeFile) { _filesByProject[projectName].Add(xmlSourceCodeFile); }