// Decompiled with JetBrains decompiler
// Type: HPG_68D.InputPasswordForm
// Assembly: HPG-68D, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 530C99A8-8EEF-42C8-8A74-66FDE7B322C3
// Assembly location: C:\Program Files (x86)\HONGKAIDE\HPG-68D\HPG-68D.exe

using HPG_68D.My;
using Microsoft.VisualBasic.CompilerServices;
using System;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Text;
using System.Windows.Forms;


namespace HPG_68D
{
  [DesignerGenerated]
  public class InputPasswordForm : Form
  {
    private static ArrayList __ENCList = new ArrayList();
    private IContainer components;
    [AccessedThroughProperty("OK_Button")]
    private Button _OK_Button;
    [AccessedThroughProperty("Cancel_Button")]
    private Button _Cancel_Button;
    [AccessedThroughProperty("Label1")]
    private Label _Label1;
    [AccessedThroughProperty("TextBox1")]
    private TextBox _TextBox1;

    [DebuggerNonUserCode]
    static InputPasswordForm()
    {
    }

    [DebuggerNonUserCode]
    public InputPasswordForm()
    {
      this.FormClosing += new FormClosingEventHandler(this.InputPasswordForm_FormClosing);
      this.Load += new EventHandler(this.InputPasswordForm_Load);
      InputPasswordForm.__ENCList.Add((object) new WeakReference((object) this));
      this.InitializeComponent();
    }

    [DebuggerNonUserCode]
    protected override void Dispose(bool disposing)
    {
      if (disposing && this.components != null)
        this.components.Dispose();
      base.Dispose(disposing);
    }

    [DebuggerStepThrough]
    private void InitializeComponent()
    {
      ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (InputPasswordForm));
      this.OK_Button = new Button();
      this.Cancel_Button = new Button();
      this.Label1 = new Label();
      this.TextBox1 = new TextBox();
      this.SuspendLayout();
      this.OK_Button.AccessibleDescription = (string) null;
      this.OK_Button.AccessibleName = (string) null;
      componentResourceManager.ApplyResources((object) this.OK_Button, "OK_Button");
      this.OK_Button.BackgroundImage = (Image) null;
      this.OK_Button.Font = (Font) null;
      this.OK_Button.Name = "OK_Button";
      this.Cancel_Button.AccessibleDescription = (string) null;
      this.Cancel_Button.AccessibleName = (string) null;
      componentResourceManager.ApplyResources((object) this.Cancel_Button, "Cancel_Button");
      this.Cancel_Button.BackgroundImage = (Image) null;
      this.Cancel_Button.DialogResult = DialogResult.Cancel;
      this.Cancel_Button.Font = (Font) null;
      this.Cancel_Button.Name = "Cancel_Button";
      this.Label1.AccessibleDescription = (string) null;
      this.Label1.AccessibleName = (string) null;
      componentResourceManager.ApplyResources((object) this.Label1, "Label1");
      this.Label1.Font = (Font) null;
      this.Label1.Name = "Label1";
      this.TextBox1.AccessibleDescription = (string) null;
      this.TextBox1.AccessibleName = (string) null;
      componentResourceManager.ApplyResources((object) this.TextBox1, "TextBox1");
      this.TextBox1.BackgroundImage = (Image) null;
      this.TextBox1.Font = (Font) null;
      this.TextBox1.Name = "TextBox1";
      this.AccessibleDescription = (string) null;
      this.AccessibleName = (string) null;
      componentResourceManager.ApplyResources((object) this, "$this");
      this.AutoScaleMode = AutoScaleMode.Font;
      this.BackgroundImage = (Image) null;
      this.Controls.Add((Control) this.Cancel_Button);
      this.Controls.Add((Control) this.OK_Button);
      this.Controls.Add((Control) this.TextBox1);
      this.Controls.Add((Control) this.Label1);
      this.Font = (Font) null;
      this.FormBorderStyle = FormBorderStyle.FixedDialog;
      this.MaximizeBox = false;
      this.MinimizeBox = false;
      this.Name = nameof (InputPasswordForm);
      this.ResumeLayout(false);
      this.PerformLayout();
    }

    internal virtual Button OK_Button
    {
      [DebuggerNonUserCode] get => this._OK_Button;
      [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
      {
        if (this._OK_Button != null)
          this._OK_Button.Click -= new EventHandler(this.OK_Button_Click);
        this._OK_Button = value;
        if (this._OK_Button == null)
          return;
        this._OK_Button.Click += new EventHandler(this.OK_Button_Click);
      }
    }

    internal virtual Button Cancel_Button
    {
      [DebuggerNonUserCode] get => this._Cancel_Button;
      [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
      {
        if (this._Cancel_Button != null)
          this._Cancel_Button.Click -= new EventHandler(this.Cancel_Button_Click);
        this._Cancel_Button = value;
        if (this._Cancel_Button == null)
          return;
        this._Cancel_Button.Click += new EventHandler(this.Cancel_Button_Click);
      }
    }

    internal virtual Label Label1
    {
      [DebuggerNonUserCode] get => this._Label1;
      [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => this._Label1 = value;
    }

    internal virtual TextBox TextBox1
    {
      [DebuggerNonUserCode] get => this._TextBox1;
      [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
      {
        this._TextBox1 = value;
      }
    }

    private void OK_Button_Click(object sender, EventArgs e)
    {
      publicva.MSCommTimeOut = 40U;
      publicva.Rw_PasswordStr = this.TextBox1.Text;
      publicva.MSCommStatus = 2U;
      publicva.ReceivedCount = 5U;
      publicva.SendDataBuf[0] = (byte) 2;
      publicva.SendDataBuf[1] = (byte) 35;
      publicva.SendDataBuf[2] = (byte) 227;
      publicva.SendDataBuf[3] = (byte) 248;
      Encoding.ASCII.GetBytes(publicva.Rw_PasswordStr.PadRight(16), 0, 16, publicva.SendDataBuf, 4);
      publicva.SendDataBuf[20] = (byte) 3;
      MyProject.Forms.MDIParent1.SerialPort1.Write(publicva.SendDataBuf, 0, 21);
      MyProject.Forms.MDIParent1.Timer1.Enabled = true;
      this.Close();
    }

    private void Cancel_Button_Click(object sender, EventArgs e)
    {
      publicva.MSCommStatus = 6U;
      MyProject.Forms.MDIParent1.Timer1.Enabled = true;
      this.Close();
    }

    private void InputPasswordForm_FormClosing(object sender, FormClosingEventArgs e)
    {
      MyProject.Forms.MDIParent1.Timer1.Enabled = true;
    }

    private void InputPasswordForm_Load(object sender, EventArgs e) => publicva.MSCommStatus = 6U;
  }
}
