public ucRatio(string id) { InitializeComponent(); ucID = id; mRatio = new pts_proj_ratio(); txt1.TextChanged += txt1_TextChanged; txt2.TextChanged += txt2_TextChanged; txt3.TextChanged += txt3_TextChanged; }
private List <pts_proj_ratio> getRatioList() { List <pts_proj_ratio> list = new List <pts_proj_ratio>(); foreach (UserControl _uc in panel1.Children) { pts_proj_ratio obj = new pts_proj_ratio(); obj.KEY1 = (_uc as ucRatio).mRatio.KEY1; obj.KEY2 = (_uc as ucRatio).mRatio.KEY2; obj.RATIO = (_uc as ucRatio).mRatio.RATIO; list.Add(obj); } return(list); }
public ucRatio(string id, pts_proj_ratio ratio) { InitializeComponent(); ucID = id; this.txt1.Text = ratio.KEY1; this.txt2.Text = ratio.KEY2; this.txt3.Text = ratio.RATIO; mRatio = ratio; mTxt1 = txt1.Text; mTxt2 = txt2.Text; mTxt3 = txt3.Text; txt1.TextChanged += txt1_TextChanged; txt2.TextChanged += txt2_TextChanged; txt3.TextChanged += txt3_TextChanged; }