forked from ccnet/CruiseControl.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfirmationPage.cs
More file actions
67 lines (65 loc) · 2.33 KB
/
Copy pathConfirmationPage.cs
File metadata and controls
67 lines (65 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace ThoughtWorks.CruiseControl.MigrationWizard
{
public partial class ConfirmationPage : WizardPageBase
{
public ConfirmationPage()
{
InitializeComponent();
NextPage = new ProgressPage();
}
public override void RunPage()
{
var builder = new StringBuilder();
if (MigrationOptions.MigrateServer)
{
builder.AppendFormat("Migrate server files from '{0}'{2}\tto '{1}'{2}",
MigrationOptions.CurrentServerLocation,
MigrationOptions.NewServerLocation,
Environment.NewLine);
builder.AppendLine();
}
if (MigrationOptions.MigrateConfiguration)
{
builder.AppendFormat("Migrate configuration settings in '{0}'{1}",
MigrationOptions.ConfigurationLocation,
Environment.NewLine);
if (MigrationOptions.BackupConfiguration)
{
builder.AppendFormat("Back up '{0}'{2}\tto '{1}' before migration{2}",
MigrationOptions.ConfigurationLocation,
Path.Combine(Path.GetDirectoryName(MigrationOptions.ConfigurationLocation),
"ccnet.config.bak"),
Environment.NewLine);
}
builder.AppendLine();
}
if (MigrationOptions.MigrateWebDashboard)
{
builder.AppendFormat("Migrate web dashboard files from '{0}'{2}\tto '{1}'{2}",
MigrationOptions.CurrentWebDashboardLocation,
MigrationOptions.NewWebDashboardLocation,
Environment.NewLine);
builder.AppendLine();
}
var message = builder.ToString();
if (string.IsNullOrEmpty(message))
{
message = "No migration options selected!";
IsValid = false;
}
else
{
IsValid = true;
}
confirmationBox.Text = message;
}
}
}