-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMoveItemActionEditor.cs
71 lines (65 loc) · 2.92 KB
/
MoveItemActionEditor.cs
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
68
69
70
71
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;
using Inedo.BuildMaster.Extensibility.Actions;
using Inedo.BuildMaster.Web.Controls;
using Inedo.BuildMaster.Web.Controls.Extensions;
using Inedo.Web.Controls;
namespace Inedo.BuildMasterExtensions.Artifactory
{
internal sealed class MoveItemActionEditor : ArtifactoryActionBaseEditor
{
private ValidatingTextBox txtSourceItem;
private ValidatingTextBox txtDestinationRepository;
private ValidatingTextBox txtDestionationItemName;
private CheckBox chkSuppressCrossLayoutTranslation;
public MoveItemActionEditor ()
{
this.extensionInstance = new MoveItemAction();
}
public override void BindToForm(ActionBase extension)
{
var action = (MoveItemAction) extension;
this.EnsureChildControls();
base.BindToForm(extension);
this.txtSourceItem.Text = action.SourceItemName;
this.txtDestinationRepository.Text = action.DestinationRepository;
this.txtDestionationItemName.Text = action.DestinationItemName;
this.chkSuppressCrossLayoutTranslation.Checked = action.SuppressCrossLayoutTranslation;
}
public override ActionBase CreateFromForm()
{
this.EnsureChildControls();
return PopulateProperties(new MoveItemAction() {
SourceItemName = this.txtSourceItem.Text,
DestinationRepository = this.txtDestinationRepository.Text,
DestinationItemName = this.txtDestionationItemName.Text,
SuppressCrossLayoutTranslation = this.chkSuppressCrossLayoutTranslation.Checked
}
);
}
protected override void CreateChildControls()
{
base.CreateChildControls();
this.txtSourceItem = new ValidatingTextBox() { Width = 300 };
this.txtDestinationRepository = new ValidatingTextBox() { Width = 300 };
this.txtDestionationItemName = new ValidatingTextBox() { Width = 300 };
this.chkSuppressCrossLayoutTranslation = new CheckBox() { Width = 300 };
this.Controls.Add(new FormFieldGroup("Source", "Source Item Information", false,
new StandardFormField("Source Name:",txtSourceItem)
)
);
this.Controls.Add(new FormFieldGroup("Destination","Destination Information:",false,
new StandardFormField("Destination Repository:",txtDestinationRepository),
new StandardFormField("Destination Name:",txtDestionationItemName)
)
);
this.Controls.Add(new FormFieldGroup("Options", "Other options", true,
new StandardFormField("Suppress Cross Layout Translation", chkSuppressCrossLayoutTranslation)
)
);
}
}
}