123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- using System;
- using System.Windows.Forms;
- using FastReport.Forms;
- using FastReport.Utils;
- namespace FastReport.Cloud.StorageClient.S3
- {
- /// <summary>
- /// Represents the Client Info diabolg form.
- /// </summary>
- 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
- /// <summary>
- /// Initializes a new instance of the <see cref="ClientInfoForm"/> class.
- /// </summary>
- public ClientInfoForm()
- {
- this.accessKeyId = "";
- this.secretAccessKey = "";
- this.region = "";
- this.host = "";
- InitializeComponent();
- Localize();
- UIUtils.CheckRTL(this);
- UpdateDpiDependencies();
- }
- #endregion // Constructors
- #region Public Methods
- /// <inheritdoc/>
- 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
- }
- }
|