public void Alter(List <string> contents, ProjectPlan plan) { GenericEnumerableExtensions.Each <string>(from x in this._additions select plan.ApplySubstitutionsRaw(x, null) into x where !contents.Contains(x) select x, new Action <string>(contents.Add)); }
public void Alter(CsProjFile file, ProjectPlan plan) { string includePath = plan.ApplySubstitutionsRaw(this._relativePath, null); string filename = FubuCore.StringExtensions.AppendPath(FubuCore.StringExtensions.ParentDirectory(file.FileName), new string[] { includePath }); if (!filename.EndsWith(".cs")) { filename += ".cs"; } string text = plan.ApplySubstitutionsRaw(this._rawText, this._relativePath); new FileSystem().WriteStringToFile(filename, text); file.Add <CodeFile>(includePath); }
public void Alter(CsProjFile file, ProjectPlan plan) { FileSystem fileSystem = new FileSystem(); string rawText = fileSystem.ReadStringFromFile(this._source); string templatedText = plan.ApplySubstitutionsRaw(rawText, this._relativePath); string expectedPath = FubuCore.StringExtensions.AppendPath(file.ProjectDirectory, new string[] { this._relativePath }); fileSystem.WriteStringToFile(expectedPath, templatedText); file.Add <Content>(new Content(this._relativePath)); }