-
Notifications
You must be signed in to change notification settings - Fork 0
/
SetItemPropertiesActionEditor.cs
52 lines (46 loc) · 1.87 KB
/
SetItemPropertiesActionEditor.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
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 SetItemPropertiesActionEditor : ArtifactoryActionBaseEditor
{
private ValidatingTextBox txtItemName;
private ValidatingTextBox txtProperties;
public SetItemPropertiesActionEditor ()
{
this.extensionInstance = new SetItemPropertiesAction();
}
public override void BindToForm(ActionBase extension)
{
var action = (SetItemPropertiesAction) extension;
this.EnsureChildControls();
base.BindToForm(extension);
this.txtItemName.Text = action.ItemName;
this.txtProperties.Text = action.Properties;
}
public override ActionBase CreateFromForm()
{
this.EnsureChildControls();
return PopulateProperties(new SetItemPropertiesAction() { ItemName= this.txtItemName.Text, Properties = this.txtProperties.Text }
);
}
protected override void CreateChildControls()
{
base.CreateChildControls();
this.txtItemName = new ValidatingTextBox() { Width = 300 };
this.txtProperties = new ValidatingTextBox() { Width = 300, TextMode = TextBoxMode.MultiLine };
this.Controls.Add(new FormFieldGroup("Information","Item Information. If item is a directory then the properties will be set recursivly on all items.",true,
new StandardFormField("Item Name:",txtItemName),
new StandardFormField("Properties:",txtProperties )
)
);
}
}
}