This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
AzureConfigurerEditor.cs
58 lines (51 loc) · 2.07 KB
/
AzureConfigurerEditor.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
using System;
using Inedo.BuildMaster.Extensibility.Configurers.Extension;
using Inedo.BuildMaster.Web.Controls.Extensions;
using Inedo.Web.Controls;
namespace Inedo.BuildMasterExtensions.Azure
{
internal sealed class AzureConfigurerEditor : ExtensionConfigurerEditorBase
{
private Inedo.Web.FileBrowserTextBox sdkPath;
private ValidatingTextBox txtSubscriptionID;
private ValidatingTextBox txtCertificateName;
public AzureConfigurerEditor()
{
this.sdkPath = new Inedo.Web.FileBrowserTextBox();
this.sdkPath.ID = "sdkPath";
this.txtSubscriptionID = new ValidatingTextBox() { Width = 300 };
this.txtCertificateName = new ValidatingTextBox() { Width = 300 };
}
public override void BindToForm(ExtensionConfigurerBase extension)
{
var configurer = (AzureConfigurer)extension;
this.sdkPath.Text = configurer.AzureSDKPath;
this.txtSubscriptionID.Text = configurer.Credentials.SubscriptionID;
this.txtCertificateName.Text = configurer.Credentials.CertificateName;
}
public override ExtensionConfigurerBase CreateFromForm()
{
return new AzureConfigurer
{
ServerID = 1,
AzureSDKPath = this.sdkPath.Text,
Credentials = new AzureAuthentication() { SubscriptionID = this.txtSubscriptionID.Text, CertificateName = this.txtCertificateName.Text }
};
}
protected override void OnLoad(EventArgs e)
{
int sourceId = 1;
sdkPath.ServerId = sourceId;
base.OnLoad(e);
}
protected override void OnInit(EventArgs e)
{
this.Controls.Add(
new SlimFormField("SDK path:", sdkPath),
new SlimFormField("Subscription ID:", txtSubscriptionID),
new SlimFormField("Certificate Name:", txtCertificateName)
);
base.OnInit(e);
}
}
}