/// <summary> /// 输出类型数据绑定,从XML文件中获取 /// </summary> public void ComBoxDataBind() { string sPath = FileManage.getApplicatonPath(); //string sPath = Application.StartupPath; sPath = sPath + "ImageFormatType.xml"; List <string> list = XmlManage.getXmlListByNodesName(sPath, "ImageFormatType", "OutPutType", "Name"); this.cbx_FormatType.DataSource = list; }
/// <summary> /// 输出类型数据绑定,从XML文件中获取 /// </summary> public void ComBoxDataBind() { string sPath = FileManage.getApplicatonPath(); sPath = sPath + "ImageFormatType.xml"; List <string> listHJSensorType = XmlManage.getXmlListByNodesName(sPath, "ImageFormatType", "HJSensorType", "Name"); this.cbx_SensorType.DataSource = listHJSensorType; List <string> listHJBandType = XmlManage.getXmlListByNodesName(sPath, "ImageFormatType", "HJBandType", "Name"); string[] sBandBlue = listHJBandType.ToArray(); this.cbx_BandBlue.DataSource = sBandBlue; string[] sBandGreen = listHJBandType.ToArray(); this.cbx_BandGreen.DataSource = sBandGreen; string[] sBandRed = listHJBandType.ToArray(); this.cbx_BandRed.DataSource = sBandRed; string[] sBandNInfrared = listHJBandType.ToArray(); this.cbx_BandNInfrared.DataSource = sBandNInfrared; }
/// <summary> /// InputFileselect,mutiply /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_InPutFile_Click(object sender, EventArgs e) { this.listViewImage.GridLines = true; OpenFileDialog dlg = new OpenFileDialog(); //创建一个OpenFileDialog string sPath = FileManage.getApplicatonPath(); sPath = sPath + "ImageFormatType.xml"; List <string> list = XmlManage.getXmlListByNodesName(sPath, "ImageFormatType", "InputType", "Name"); string strs = ""; string str1 = ""; string str2 = ""; for (int i = 0; i < list.Count; i++) { var item = list[i].ToString(); str1 += item + ";"; str2 += item + ";"; strs += "(" + item + ")|" + item + "|"; } //MessageBox.Show("str1=" + str1 + "\n" + " str2=" + str2); string str3 = "(" + str1 + ")|" + str2 + "|"; strs = strs + "(*.*)|*.*"; dlg.Filter = str3 + strs; dlg.Multiselect = true;//设置属性为多选 if (dlg.ShowDialog() == DialogResult.OK) { string str = " "; for (int i = 0; i < dlg.FileNames.Length; i++) //根据数组长度定义循环次数 { str = dlg.FileNames.GetValue(i).ToString(); //获取文件文件名 ListViewItem item = new ListViewItem() { Text = " " + str }; this.listViewImage.Items.Add(item); } } }