public void post_snippet_edit(SnippetRequest request) { var snippet = get_snippet_Bottle_Name(request); var file = _files.Find(snippet.File); EditorLauncher.LaunchFile(file.Path); }
public override bool Execute(ViewInput input) { Location location = ProjectFinder.DetermineLocation(Environment.CurrentDirectory); ViewModelBuilder.BuildCodeFile(input, location); var modelName = location.Namespace + "." + input.Name; var path = SparkViewBuilder.Write(Environment.CurrentDirectory, modelName); if (input.OpenFlag) { EditorLauncher.LaunchFile(path); } return(true); }
public static void BuildView(ViewInput input) { Location location = ProjectFinder.DetermineLocation(Environment.CurrentDirectory); var template = FileTemplate.Find(location, input.TemplateFlag); ViewModelBuilder.BuildCodeFile(input, location); var modelName = location.Namespace + "." + input.Name; var path = ViewBuilder.Write(template, location, modelName); var viewPath = path.PathRelativeTo(location.ProjectFolder()).Replace('\\', '/'); location.Project.Add(new Content(viewPath)); location.Project.Save(); if (input.OpenFlag) { EditorLauncher.LaunchFile(path); } }
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); }
public void post_edit_file(FileRequest request) { var topic = TopicGraph.AllTopics.Find(request.Key); EditorLauncher.LaunchFile(topic.File.FilePath); }