public override sealed CommandExecutionResult Execute()
        {
            CommandExecutionResult result = new CommandExecutionResult(this);
            try
            {
                CheckOutUICommand checkOutCommand = new CheckOutUICommand(Selection);
                checkOutCommand.DoNotCheckOutWhenLocalDirectoryExists = true;
                checkOutCommand.ReportProgress += delegate(object sender, IUICommandReportProgressEventArgs eventArgs)
                                                      {
                                                          InvokeReportProgress(eventArgs.Message);
                                                      };
                CommandExecutionResult checkOutCommandExecutionResult = checkOutCommand.Execute();
                if (checkOutCommandExecutionResult.Error != null)
                    throw checkOutCommandExecutionResult.Error;

                ParserContext context = new ParserContext();
                FillContext(context);

                DirectoryInfo targetDir = new DirectoryInfo((string)checkOutCommandExecutionResult.CommandOutput);

                TemplateHelper.GenerateTemplateHierarchy(targetDir, baseTemplateDir, context, Encoding);
                result.CommandOutput = targetDir;

                result.NewProjectFile = new FileInfo(Path.Combine(targetDir.FullName, string.Concat(GetProjectName(Selection.SvnUri), ".nant")));
            }
            catch (Exception ex)
            {
                result.Error = ex;
            }
            return result;
        }
Esempio n. 2
0
 private void OnToolStripButtonCheckOutClick(object sender, EventArgs e)
 {
     // Access CheckOutdirectory to ensure there is a value.
     NAntConsoleConfigurationSection.GetCheckOutDirectory();
     SvnExplorer svnExplorer = new SvnExplorer();
     if (svnExplorer.ShowDialog(this) == DialogResult.OK)
     {
         CheckOutUICommand checkOutUICommand = new CheckOutUICommand(svnExplorer.GetSvnExplorerSelection());
         RunASyncCommand(checkOutUICommand);
     }
 }