📄 formabout.cs
字号:
namespace Codematic
{
using Maticsoft.AddInManager;
using System;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
public class FormAbout : Form
{
private Button btn_Ok;
private IContainer components;
private DataSet dsAddin;
private Label label1;
private Label label3;
private Label label4;
private Label label5;
private Label label6;
private Label lblDesc;
private Label lblVer;
private ListBox listBox1;
private Panel panel1;
public FormAbout()
{
this.InitializeComponent();
}
private void BindListbox()
{
try
{
this.dsAddin = new AddIn().GetAddInList();
this.listBox1.Items.Clear();
if ((this.dsAddin != null) && (this.dsAddin.Tables[0].Rows.Count > 0))
{
foreach (DataRow row in this.dsAddin.Tables[0].Rows)
{
string str = row["Guid"].ToString();
string str2 = row["Name"].ToString();
string str3 = row["Version"].ToString();
this.listBox1.Items.Add(str2 + " " + str3 + " " + str);
}
}
}
catch (SystemException exception)
{
string message = exception.Message;
}
}
private void btn_Ok_Click(object sender, EventArgs e)
{
base.Close();
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private void FormAbout_Load(object sender, EventArgs e)
{
this.lblVer.Text = "版本:" + Application.ProductVersion + " (Build 090103)";
this.BindListbox();
}
private void InitializeComponent()
{
ComponentResourceManager manager = new ComponentResourceManager(typeof(FormAbout));
this.label1 = new Label();
this.lblVer = new Label();
this.label3 = new Label();
this.label4 = new Label();
this.btn_Ok = new Button();
this.label5 = new Label();
this.listBox1 = new ListBox();
this.label6 = new Label();
this.panel1 = new Panel();
this.lblDesc = new Label();
this.panel1.SuspendLayout();
base.SuspendLayout();
this.label1.AutoSize = true;
this.label1.BackColor = Color.Transparent;
this.label1.Location = new Point(12, 0x54);
this.label1.Name = "label1";
this.label1.Size = new Size(0x77, 12);
this.label1.TabIndex = 0;
this.label1.Text = "Maticsoft Codematic";
this.lblVer.AutoSize = true;
this.lblVer.BackColor = Color.Transparent;
this.lblVer.Location = new Point(12, 0x62);
this.lblVer.Name = "lblVer";
this.lblVer.Size = new Size(0x95, 12);
this.lblVer.TabIndex = 0;
this.lblVer.Text = "版本:2.0 (Alpha.070124)";
this.label3.AutoSize = true;
this.label3.BackColor = Color.Transparent;
this.label3.Location = new Point(12, 0x70);
this.label3.Name = "label3";
this.label3.Size = new Size(0x143, 12);
this.label3.TabIndex = 0;
this.label3.Text = "Copyright(C) 2004-2008 Maticsoft All Rights Reserved.";
this.label4.BackColor = Color.Transparent;
this.label4.Location = new Point(12, 0x12e);
this.label4.Name = "label4";
this.label4.Size = new Size(0x19d, 40);
this.label4.TabIndex = 0;
this.label4.Text = "警告; 本计算机程序受版权法和国际条约保护。如未经授权而擅自复制或传播本程序(或其中任何部分),将受到严厉的民事或刑事制裁,并将在法律许可的最大限度内受到起诉。";
this.btn_Ok.Location = new Point(0x1bc, 0x12e);
this.btn_Ok.Name = "btn_Ok";
this.btn_Ok.Size = new Size(0x52, 0x17);
this.btn_Ok.TabIndex = 1;
this.btn_Ok.Text = "确定";
this.btn_Ok.UseVisualStyleBackColor = true;
this.btn_Ok.Click += new EventHandler(this.btn_Ok_Click);
this.label5.AutoSize = true;
this.label5.BackColor = Color.Transparent;
this.label5.Location = new Point(12, 0x8a);
this.label5.Name = "label5";
this.label5.Size = new Size(0x65, 12);
this.label5.TabIndex = 0;
this.label5.Text = "已安装的产品(&I):";
this.listBox1.FormattingEnabled = true;
this.listBox1.ItemHeight = 12;
this.listBox1.Location = new Point(14, 0x99);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new Size(0x19b, 0x40);
this.listBox1.TabIndex = 2;
this.listBox1.SelectedIndexChanged += new EventHandler(this.listBox1_SelectedIndexChanged);
this.label6.AutoSize = true;
this.label6.BackColor = Color.Transparent;
this.label6.Location = new Point(12, 0xde);
this.label6.Name = "label6";
this.label6.Size = new Size(0x53, 12);
this.label6.TabIndex = 0;
this.label6.Text = "产品详细信息:";
this.panel1.BackColor = Color.Transparent;
this.panel1.BorderStyle = BorderStyle.FixedSingle;
this.panel1.Controls.Add(this.lblDesc);
this.panel1.Location = new Point(14, 0xed);
this.panel1.Name = "panel1";
this.panel1.Size = new Size(0x19b, 0x2e);
this.panel1.TabIndex = 3;
this.lblDesc.AutoSize = true;
this.lblDesc.Location = new Point(3, 3);
this.lblDesc.Name = "lblDesc";
this.lblDesc.Size = new Size(0, 12);
this.lblDesc.TabIndex = 0;
base.AutoScaleDimensions = new SizeF(6f, 12f);
base.AutoScaleMode = AutoScaleMode.Font;
this.BackgroundImage = (Image) manager.GetObject("$this.BackgroundImage");
base.ClientSize = new Size(0x21a, 0x16d);
base.Controls.Add(this.panel1);
base.Controls.Add(this.listBox1);
base.Controls.Add(this.btn_Ok);
base.Controls.Add(this.label4);
base.Controls.Add(this.label3);
base.Controls.Add(this.label6);
base.Controls.Add(this.label5);
base.Controls.Add(this.lblVer);
base.Controls.Add(this.label1);
base.FormBorderStyle = FormBorderStyle.FixedDialog;
base.Icon = (Icon) manager.GetObject("$this.Icon");
base.MaximizeBox = false;
base.MinimizeBox = false;
base.Name = "FormAbout";
base.StartPosition = FormStartPosition.CenterScreen;
this.Text = "关于 Codematic";
base.Load += new EventHandler(this.FormAbout_Load);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
base.ResumeLayout(false);
base.PerformLayout();
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.listBox1.SelectedItem != null)
{
string str = this.listBox1.SelectedItem.ToString();
int startIndex = str.LastIndexOf(" ");
string str2 = str.Substring(startIndex).Trim();
DataRow[] rowArray = this.dsAddin.Tables[0].Select("Guid='" + str2 + "'");
if (rowArray.Length > 0)
{
this.lblDesc.Text = rowArray[0]["Decription"].ToString();
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -