123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- using System;
- using System.Windows.Forms;
- using FastReport.Forms;
- using FastReport.Utils;
- namespace FastReport.Cloud.StorageClient.Box
- {
- /// <summary>
- /// Represents the Client Info dialog form.
- /// </summary>
- public partial class ClientInfoForm : BaseDialogForm
- {
- #region Fields
- #pragma warning disable FR0001 // Field names must be longer than 2 characters.
- private string id;
- #pragma warning restore FR0001 // Field names must be longer than 2 characters.
- private string secret;
- #endregion // Fields
- #region Properties
- /// <summary>
- /// Gets the client ID.
- /// </summary>
- public string Id
- {
- get { return id; }
- }
- /// <summary>
- /// Gets the client secret.
- /// </summary>
- public string Secret
- {
- get { return secret; }
- }
- #endregion // Properties
- #region Constructors
- /// <summary>
- /// Initializes a new instance of the <see cref="ClientInfoForm"/> class.
- /// </summary>
- public ClientInfoForm()
- {
- this.id = "";
- this.secret = "";
- InitializeComponent();
- Localize();
- UIUtils.CheckRTL(this);
- }
- #endregion // Constructors
- #region Public Methods
- /// <inheritdoc/>
- public override void Localize()
- {
- base.Localize();
- MyRes res = new MyRes("Cloud,Box");
- this.Text = res.Get("ClientInfoDialog");
- labelClientId.Text = res.Get("ClientId");
- labelClientSecret.Text = res.Get("ClientSecret");
- }
- #endregion // Public Methods
- #region Events Handlers
- private void btnOk_Click(object sender, EventArgs e)
- {
- id = tbClientId.Text;
- secret = tbClientSecret.Text;
- this.Close();
- }
- private void ClientInfoForm_FormClosing(object sender, FormClosingEventArgs e)
- {
- if (String.IsNullOrEmpty(id) || String.IsNullOrEmpty(secret))
- {
- if (DialogResult != DialogResult.OK)
- {
- return;
- }
- else
- {
- FRMessageBox.Error(new MyRes("Messages").Get("EmptyDataEntryField"));
- e.Cancel = true;
- }
- }
- }
- #endregion // Events Handlers
- }
- }
|