using System;
using System.Windows.Forms;
using FastReport.Forms;
using FastReport.Utils;
namespace FastReport.Cloud.StorageClient.S3
{
///
/// Represents the Client Info diabolg form.
///
public partial class ClientInfoForm : BaseDialogForm
{
#region Fields
private string accessKeyId;
private string secretAccessKey;
private string region;
private string host;
#endregion // Fields
#region Properties
public string AccessKeyId
{
get { return accessKeyId; }
set
{
accessKeyId = value;
tbAccessKeyId.Text = value;
}
}
public string SecretAccessKey
{
get { return secretAccessKey; }
set
{
secretAccessKey = value;
tbSecretAccessKey.Text = value;
}
}
public string Region
{
get { return region; }
set
{
region = value;
tbRegion.Text = region;
}
}
public string Host
{
get { return host; }
set
{
host = value;
tbHost.Text = value;
}
}
#endregion // Properties
#region Constructors
///
/// Initializes a new instance of the class.
///
public ClientInfoForm()
{
this.accessKeyId = "";
this.secretAccessKey = "";
this.region = "";
this.host = "";
InitializeComponent();
Localize();
UIUtils.CheckRTL(this);
UpdateDpiDependencies();
}
#endregion // Constructors
#region Public Methods
///
public override void Localize()
{
base.Localize();
MyRes res = new MyRes("Cloud,S3");
this.Text = res.Get("ClientInfoDialog");
lbAccessKeyId.Text = res.Get("AccessKeyId");
lbSecretAccessKey.Text = res.Get("SecretAccessKey");
lbRegion.Text = res.Get("Region");
lbHost.Text = res.Get("Host");
}
#endregion // Public Methods
#region Events Handlers
private void btnOk_Click(object sender, EventArgs e)
{
accessKeyId = tbAccessKeyId.Text;
this.secretAccessKey = tbSecretAccessKey.Text;
this.region = tbRegion.Text;
this.host = tbHost.Text;
XmlItem xi = Config.Root.FindItem("S3").FindItem("StorageSettings");
xi.SetProp("AccessKeyId", accessKeyId);
xi.SetProp("SecretAccessKey", secretAccessKey);
xi.SetProp("Region", region);
xi.SetProp("Host", host);
this.Close();
}
#endregion // Events Handlers
}
}