📄 field.cs
字号:
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Collections;
using System.Windows.Forms;
using System.Drawing;
using System.Reflection;
namespace LC_DataIO
{
public partial class Field :FlowLayoutPanel
{
private string fieldName = "";
private string type = "数字";
private ArrayList types = new ArrayList();
private int t;
public ArrayList Types
{
get { return types; }
set
{
types = value;
for (int i = 0; i < types.Count; i++)
{
this.formater_cbx.Items.Add(types[i].ToString());
}
}
}
public string Type
{
get { return type; }
set { type = value; }
}
public MethodInfo curFormater = null;
public string FieldName
{
get { return fieldName; }
set
{
fieldName = value;
this.fieldname_btn.Text = fieldName;
}
}
private Hashtable formaters = new Hashtable();
public Hashtable Formaters
{
get { return formaters; }
set
{
formaters = value;
this.formater_cbx.Items.Clear();
IDictionaryEnumerator ide = formaters.GetEnumerator();
while (ide.MoveNext())
{
formater_cbx.Items.Add(ide.Key.ToString());
}
}
}
public Field(int type)
{
t = type;
InitializeComponent();
this.Controls.Add(this.fieldname_btn);
this.Controls.Add(this.formater_cbx);
this.Size = new System.Drawing.Size(300, 30);
this.BackColor = Color.Red;
}
public string getFormatSourceStr(string str)
{
if(curFormater!=null)
return curFormater.Invoke(null, new object[] { str }).ToString();
return "";
}
private void formater_cbx_SelectedValueChanged(object sender, EventArgs e)
{
if(t==0)
type = this.formater_cbx.Text.ToString();
else if(t==1)
curFormater = (MethodInfo)formaters[this.formater_cbx.Text.ToString()];
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -