private void RadioButton_Click(object sender, EventArgs e) { RadioButton rbt = sender as RadioButton; string panel = rbt.Tag as string; if (string.IsNullOrEmpty(panel)) { return; } //首先查找全部radio控制项【联动控制隐藏】 List <Control> bindPanels = new PageDataHelp().ForeachPanel(switchPanel, typeof(RadioButton).Name);// switchPanel.Controls; foreach (Control item in bindPanels) { string hide = item.Tag as string; Control[] targets = this.Controls.Find(hide, false); foreach (Control ch in targets) { if (panel == hide) { ch.Visible = true; } else { ch.Visible = false; } } } }
private UrlData PickUpUrlData() { PageDataHelp data = new PageDataHelp(); UrlData url = data.GetClassFromControl <UrlData>(this.Controls, new UrlData()); CommonFormat cf = new CommonFormat(); string param = cf.DateTimeIntFormatString; if (string.IsNullOrEmpty(url.UrlKey)) { url.UrlKey = param; } if (!string.IsNullOrEmpty(url.WebName) && string.IsNullOrEmpty(url.WebKey)) { url.WebKey = url.WebName.ConvertSpell(); } if (!string.IsNullOrEmpty(url.ParamList)) { //string[] items = url.ParamList.Split(new string[] { "\n" },StringSplitOptions.None); //string ps = string.Empty; //foreach (string item in items) //{ // if (string.IsNullOrEmpty(item)) { continue; } // string p = item.Split(':')[0]; // ps += p + ":@" + p+"\n"; //} //url.ParamList = ps; } return(url); }
void ReadXmlCfgUpdateUi() { Dictionary <string, string> dict = XmlCfgDir.GetNodeSpecialeAttribute(UiCfgNode, nodeCfgFormat); //提取目标属性 PageDataHelp page = new PageDataHelp(); foreach (var item in dict) { List <Control> ele = page.ForeachControl(this, item.Key); if (ele.Count > 0) { ele[0].Text = item.Value; } } }