Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
            }
        }