203 lines
6.2 KiB
C#
203 lines
6.2 KiB
C#
// Decompiled with JetBrains decompiler
|
|
// Type: HPG_68D.ComForm
|
|
// 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.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Diagnostics;
|
|
using System.Drawing;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Windows.Forms;
|
|
|
|
|
|
namespace HPG_68D
|
|
{
|
|
[DesignerGenerated]
|
|
public class ComForm : Form
|
|
{
|
|
private static ArrayList __ENCList = new ArrayList();
|
|
private IContainer components;
|
|
[AccessedThroughProperty("Button2")]
|
|
private Button _Button2;
|
|
[AccessedThroughProperty("Button1")]
|
|
private Button _Button1;
|
|
[AccessedThroughProperty("ComboBox1")]
|
|
private ComboBox _ComboBox1;
|
|
[AccessedThroughProperty("Label1")]
|
|
private Label _Label1;
|
|
|
|
[DebuggerNonUserCode]
|
|
static ComForm()
|
|
{
|
|
}
|
|
|
|
[DebuggerNonUserCode]
|
|
public ComForm()
|
|
{
|
|
Load += ComForm_Load;
|
|
__ENCList.Add((object) new WeakReference((object) this));
|
|
InitializeComponent();
|
|
}
|
|
|
|
[DebuggerNonUserCode]
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
if (disposing && components != null)
|
|
components.Dispose();
|
|
base.Dispose(disposing);
|
|
}
|
|
|
|
[DebuggerStepThrough]
|
|
private void InitializeComponent()
|
|
{
|
|
ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (ComForm));
|
|
Button2 = new Button();
|
|
Button1 = new Button();
|
|
ComboBox1 = new ComboBox();
|
|
Label1 = new Label();
|
|
SuspendLayout();
|
|
Button2.AccessibleDescription = (string) null;
|
|
Button2.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) Button2, "Button2");
|
|
Button2.BackgroundImage = (Image) null;
|
|
Button2.Font = (Font) null;
|
|
Button2.Name = "Button2";
|
|
Button2.UseVisualStyleBackColor = true;
|
|
Button1.AccessibleDescription = (string) null;
|
|
Button1.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) Button1, "Button1");
|
|
Button1.BackgroundImage = (Image) null;
|
|
Button1.Font = (Font) null;
|
|
Button1.Name = "Button1";
|
|
Button1.UseVisualStyleBackColor = true;
|
|
ComboBox1.AccessibleDescription = (string) null;
|
|
ComboBox1.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) ComboBox1, "ComboBox1");
|
|
ComboBox1.BackgroundImage = (Image) null;
|
|
ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
|
|
ComboBox1.Font = (Font) null;
|
|
ComboBox1.FormattingEnabled = true;
|
|
ComboBox1.Name = "ComboBox1";
|
|
Label1.AccessibleDescription = (string) null;
|
|
Label1.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) Label1, "Label1");
|
|
Label1.Font = (Font) null;
|
|
Label1.Name = "Label1";
|
|
AccessibleDescription = (string) null;
|
|
AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) this, "$this");
|
|
AutoScaleMode = AutoScaleMode.Font;
|
|
BackgroundImage = (Image) null;
|
|
Controls.Add((Control) Button2);
|
|
Controls.Add((Control) Button1);
|
|
Controls.Add((Control) ComboBox1);
|
|
Controls.Add((Control) Label1);
|
|
Font = (Font) null;
|
|
FormBorderStyle = FormBorderStyle.FixedDialog;
|
|
MaximizeBox = false;
|
|
MinimizeBox = false;
|
|
Name = nameof (ComForm);
|
|
ResumeLayout(false);
|
|
PerformLayout();
|
|
}
|
|
|
|
internal virtual Button Button2
|
|
{
|
|
[DebuggerNonUserCode] get => _Button2;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
if (_Button2 != null)
|
|
_Button2.Click -= Button2_Click;
|
|
_Button2 = value;
|
|
if (_Button2 == null)
|
|
return;
|
|
_Button2.Click += Button2_Click;
|
|
}
|
|
}
|
|
|
|
internal virtual Button Button1
|
|
{
|
|
[DebuggerNonUserCode] get => _Button1;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
if (_Button1 != null)
|
|
_Button1.Click -= Button1_Click;
|
|
_Button1 = value;
|
|
if (_Button1 == null)
|
|
return;
|
|
_Button1.Click += Button1_Click;
|
|
}
|
|
}
|
|
|
|
internal virtual ComboBox ComboBox1
|
|
{
|
|
[DebuggerNonUserCode] get => _ComboBox1;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
if (_ComboBox1 != null)
|
|
_ComboBox1.MouseClick -= ComboBox1_MouseClick;
|
|
_ComboBox1 = value;
|
|
if (_ComboBox1 == null)
|
|
return;
|
|
_ComboBox1.MouseClick += ComboBox1_MouseClick;
|
|
}
|
|
}
|
|
|
|
internal virtual Label Label1
|
|
{
|
|
[DebuggerNonUserCode] get => _Label1;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => _Label1 = value;
|
|
}
|
|
|
|
private void ComForm_Load(object sender, EventArgs e)
|
|
{
|
|
ComboBox1.SelectedIndex = checked ((int) publicva.COM_SelectIndex);
|
|
if (Operators.CompareString(publicva.Language, "zh-CN", false) == 0)
|
|
Label1.Text = "通信端口";
|
|
else
|
|
Label1.Text = "Port";
|
|
}
|
|
|
|
private void ComboBox1_MouseClick(object sender, MouseEventArgs e)
|
|
{
|
|
int selectedIndex = ComboBox1.SelectedIndex;
|
|
ComboBox1.Items.Clear();
|
|
GetSerialPortNames();
|
|
if (-1 == ComboBox1.FindString(ComboBox1.Text))
|
|
ComboBox1.SelectedIndex = 0;
|
|
else
|
|
ComboBox1.SelectedIndex = selectedIndex;
|
|
}
|
|
|
|
private void Button1_Click(object sender, EventArgs e) => Close();
|
|
|
|
public void GetSerialPortNames()
|
|
{
|
|
try
|
|
{
|
|
foreach (object serialPortName in MyProject.Computer.Ports.SerialPortNames)
|
|
ComboBox1.Items.Add(serialPortName);
|
|
}
|
|
finally
|
|
{
|
|
}
|
|
if (ComboBox1.Items.Count >= 1)
|
|
return;
|
|
ComboBox1.Items.Add((object) "COM1");
|
|
}
|
|
|
|
private void Button2_Click(object sender, EventArgs e)
|
|
{
|
|
publicva.COM_SelectIndex = checked ((uint) ComboBox1.SelectedIndex);
|
|
MyProject.Forms.MDIParent1.SerialPort1.PortName = ComboBox1.Text;
|
|
Close();
|
|
}
|
|
}
|
|
}
|