Пример #1
0
        public void Alter(CsProjFile file, ProjectPlan plan)
        {
            var includePath = plan.ApplySubstitutions(_relativePath);
            var filename = file.FileName.ParentDirectory().AppendPath(includePath);
            if (!filename.EndsWith(".cs"))
            {
                filename = filename + ".cs";
            }

            var text = plan.ApplySubstitutions(_rawText, _relativePath);

            new FileSystem().WriteStringToFile(filename, text);

            file.Add<CodeFile>(includePath);
        }
 public void Alter(List<string> contents, ProjectPlan plan)
 {
     _additions
         .Select(x => plan.ApplySubstitutions(x))
         .Where(x => !contents.Contains(x))
         .Each(contents.Add);
 }
Пример #3
0
        public void Alter(CsProjFile file, ProjectPlan plan)
        {
            var includePath = plan.ApplySubstitutions(_relativePath);
            var filename    = file.FileName.ParentDirectory().AppendPath(includePath);

            if (!filename.EndsWith(".cs"))
            {
                filename = filename + ".cs";
            }

            var text = plan.ApplySubstitutions(_rawText, _relativePath);

            new FileSystem().WriteStringToFile(filename, text);

            file.Add <CodeFile>(includePath);
        }
Пример #4
0
 public void Alter(List <string> contents, ProjectPlan plan)
 {
     _additions
     .Select(x => plan.ApplySubstitutions(x))
     .Where(x => !contents.Contains(x))
     .Each(contents.Add);
 }
Пример #5
0
        public void Alter(CsProjFile file, ProjectPlan plan)
        {
            var fileSystem = new FileSystem();
            var rawText = fileSystem.ReadStringFromFile(_source);

            var templatedText = plan.
                ApplySubstitutions(rawText, _relativePath);

            var expectedPath = file.ProjectDirectory.AppendPath(_relativePath);

            fileSystem.WriteStringToFile(expectedPath, templatedText);
        }
        public void Alter(CsProjFile file, ProjectPlan plan)
        {
            var fileSystem = new FileSystem();
            var rawText    = fileSystem.ReadStringFromFile(_source);

            var templatedText = plan.
                                ApplySubstitutions(rawText, _relativePath);

            var expectedPath = file.ProjectDirectory.AppendPath(_relativePath);

            fileSystem.WriteStringToFile(expectedPath, templatedText);

            file.Add(new Content(_relativePath));
        }