public AssemblyInfo(CodeFile codeFile, CsProjFile projFile) { _codeFile = codeFile; _projFile = projFile; this._fileSystem = new FileSystem(); this.Initialize(); }
public void SetUp() { new FileSystem().DeleteDirectory("MyLib"); new FileSystem().CreateDirectory("MyLib"); theLocation = new Location { Namespace = "MyLib.A.B", Project = CsProjFile.CreateAtSolutionDirectory("MyLib", "MyLib"), RelativePath = "A/B" }; theViewInput = new ViewInput { Name = "MyModel", UrlFlag = null }; theFile = ViewModelBuilder.BuildCodeFile(theViewInput, theLocation); }
public static CodeFile BuildCodeFile(ViewInput input, Location location) { var filename = Path.GetFileNameWithoutExtension(input.Name) + ".cs"; var path = location.Project.ProjectDirectory.AppendPath(location.RelativePath, filename); var text = createText(input, location); new FileSystem().WriteStringToFile(path, text); var file = new CodeFile(location.RelativePath.AppendPath(filename)); location.Project.Add(file); location.Project.Save(); if (input.OpenFlag) { EditorLauncher.LaunchFile(path); } return file; }