public MainViewModel(GeneratorRunner runner) { _runner = runner; WorkDirectory = _runner.WorkDirectory; ValidateConfigCommand = new DelegateCommand(this, () => _runner.Initialize()); CleanOutDirCommand = new DelegateCommand(this, () => _runner.InitializeAndExecute(x => x.DoClean())); BuildTestCommand = new DelegateCommand(this, () => _runner.InitializeAndExecute(x => x.DoTest())); BuildReleaseCommand = new DelegateCommand(this, () => _runner.InitializeAndExecute(x => x.DoBuild())); BuildPrintCommand = new DelegateCommand(this, () => _runner.InitializeAndExecute(x => x.DoPrint())); BuildEpubCommand = new DelegateCommand(this, () => _runner.InitializeAndExecute(x => x.DoEpub())); BuildWordpressCommand = new DelegateCommand(this, () => _runner.InitializeAndExecute(x => x.DoWordpress())); HelpCommand = new DelegateCommand(this, () => _runner.RunHelp()); ExitCommand = new DelegateCommand(() => View?.ExitApp()); }
public override bool Execute(string[] arguments) { BookGenArgumentBase args = new BookGenArgumentBase(); if (!ArgumentParser.ParseArguments(arguments, args)) { return(false); } GeneratorRunner runner = Program.CreateRunner(args.Verbose, args.Directory); if (runner.Initialize(false)) { runner.DoEditor(); return(true); } return(false); }