private void adtZone_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { switch (adtZone.SelectedNode.Tag.ToString()) { case "0": SetToolStripMenuItemEnable(cmsOper.Items, tsmiArea); break; case "1": SetToolStripMenuItemEnable(cmsOper.Items, tsmiCountry); break; case "2": SetToolStripMenuItemEnable(cmsOper.Items, tsmiProvince); break; case "3": SetToolStripMenuItemEnable(cmsOper.Items, tsmiCity); break; } pzid = adtZone.SelectedNode.Name.Substring(3).ToInt32(); ztype = adtZone.SelectedNode.Tag.ToInt32(); BindDataGridView(); }
/// <summary> /// Node被點擊 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void advTree1_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { if (!(e.Node.Tag is ScoreCalcRuleInfo)) { // 假如使用者點到母節點, 清掉選擇選項, 以免有問題 _SelectItem = null; BtnEnabled(false); return; } if (_SelectItem != null) { _SelectItem.Checked = false; } _SelectItem = e.Node; ScoreCalcRuleInfo info = (ScoreCalcRuleInfo)_SelectItem.Tag; _SelectItem.Checked = true; this.scoreCalcRuleEditor1.SetSource(info.ScoreCalcRuleElement); this.scoreCalcRuleEditor1.ScoreCalcRuleName = info.Name; BtnEnabled(true); scoreCalcRuleEditor1.Visible = true; }
//点击树定位 private void NodeTree_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { DevComponents.AdvTree.Node clickedNode = e.Node; Node node = clickedNode.Tag as Node; if (node != null) { //如果当前节点内容不为空,直接定位 if (string.IsNullOrEmpty(node.content) == false) { findLocation(node.content); } else//否则查找内容不为空的第一个子节点,再定位 { foreach (DevComponents.AdvTree.Node subTreeNode in clickedNode.Nodes) { Node subNode = subTreeNode.Tag as Node; if (string.IsNullOrEmpty(subNode.content) == false) { findLocation(subNode.content); } else { findLocation(subNode.title); } break; } } } }
private void tv_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { if (e.Node.Tag.ToString() != "") { iID = Convert.ToInt32(e.Node.Tag); } if (iID > 0 && ds.Tables.Count == 1) { cbxParent.SelectedIndex = -1; foreach (DataRow row in ds.Tables[0].Rows) { if (Convert.ToInt32(row["id"]) == iID) { txtName.Text = row["name"].ToString(); DataSet d = Program.SQL.SelectAll("SELECT id,name FROM schedules_sections WHERE ID=" + row["parent"].ToString() + ";"); if (d.Tables.Count > 0 && d.Tables[0].Rows.Count > 0) { foreach (DevComponents.Editors.ComboItem i in cbxParent.Items) { if (i.Tag.ToString() == d.Tables[0].Rows[0]["id"].ToString()) { cbxParent.SelectedItem = i; break; } } } break; } } } }
private void advTree1_NodeMouseUp(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { _SelectNode = null; _SelectNode = e.Node; LoadFuncontent(); }
private void advTree1_NodeDoubleClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { if (e.Button == System.Windows.Forms.MouseButtons.Right) { return; } if (e.Node.Nodes.Count != 0) { return; } string readText; string [] readList; StreamReader nowDocument = new StreamReader(DocumentPath + e.Node.Parent.Text + @"\" + e.Node.Text + ".txt", Encoding.UTF8); readText = nowDocument.ReadToEnd(); nowDocument.Close(); readList = readText.Split('\n'); this.listViewEx1.BeginUpdate(); this.listViewEx1.Items.Clear(); foreach (string text in readList) { if (text == "") { break; } this.listViewEx1.Items.Add(new ListViewItem(new string[] { text.Split('|')[0].Replace(text.Split('|')[0].Split('.')[0] + ".", ""), text.Split('|')[1], text.Replace(text.Split('.')[0] + ".", "") })); } this.listViewEx1.EndUpdate(); oldList = readList; }
private void advTreeData_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { if (!status) { if (e.Node.Tag is SensorDeviceUnit) { var collect = e.Node.Tag as SensorDeviceUnit; this.GetProperity(collect.ID, "SensorDeviceUnit"); } else if (e.Node.Tag is ControlDeviceUnit) { var control = e.Node.Tag as ControlDeviceUnit; this.GetProperity(control.ID, "ControlDeviceUnit"); } else if (e.Node.Tag is Camera) { var cam = e.Node.Tag as Camera; this.GetProperity(cam.ID, "Camera"); } else if (e.Node.Tag is ShowDevice) { var sd = e.Node.Tag as ShowDevice; this.GetProperity(sd.ID, "ShowDevice"); } else if (e.Node.Tag is Facility) { var f = e.Node.Tag as Facility; this.GetProperity(f.ID, "Facility"); } } }
/// <summary> /// WBS节点树鼠标点击事件 /// Created:20170524 (ChengMengjia) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void advTree1_MouseDown(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { IsRightClick = e.Button == System.Windows.Forms.MouseButtons.Right;//是否为右击事件 if (IsRightClick) { PNode node = JsonHelper.StringToEntity <PNode>(e.Node.Tag.ToString()); if (string.IsNullOrEmpty(node.ParentID)) { return;//顶级节点不能修改 } DataHelper.SetTreeSelectByValue(advTree1, node.ID); Point point = advTree1.PointToClient(Cursor.Position); this.toolNodeExchange.Visible = true; if (node.PType == 0) { this.toolNodeExchange.Text = "转为交付物"; } else if (node.PType == 1) { this.toolNodeExchange.Text = "转为节点"; } else { this.toolNodeExchange.Visible = false; } this.EditNodeMenu.Tag = e.Node.Tag; this.EditNodeMenu.Show(advTree1, point); } }
private void advTree1_NodeMouseUp(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { _SelectNode = null; _SelectNode = e.Node; this.textBox4.Text = (_SelectNode.Tag as FunctionRepository).Fun_Id; this.textBox5.Text = _SelectNode.Text; }
private void TreeTSI_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { if (e.Node.Level == 0) { addDDSToolStripMenuItem.Enabled = true; removeDDSToolStripMenuItem.Enabled = true; addElementToolStripMenuItem.Enabled = true; removeElementToolStripMenuItem.Enabled = false; copyTreeTSIMenuItem.Enabled = true; pasteTreeTSIMenuItem.Enabled = true; TSIDockContainer selectedTSIDockContainer = (TSIDockContainer)MainBar.SelectedDockContainerItem; selectedTSIDockContainer.SelectDDS(e.Node.Index); // oldSelectedObject = selectedTSIDockContainer.GetDDS(e.Node.Index). } if (e.Node.Level == 1) { addDDSToolStripMenuItem.Enabled = false; removeDDSToolStripMenuItem.Enabled = false; addElementToolStripMenuItem.Enabled = true; removeElementToolStripMenuItem.Enabled = true; copyTreeTSIMenuItem.Enabled = true; pasteTreeTSIMenuItem.Enabled = true; TSIDockContainer selectedTSIDockContainer = (TSIDockContainer)MainBar.SelectedDockContainerItem; selectedTSIDockContainer.SelectSprite(e.Node.Parent.Index, e.Node.Index); } }
private void advTree1_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { List <OrderDetails> listOrderDetails = objOrderDetails.SelectAll(); if (e.Node.Name.Contains("Produt_")) { this.listViewEx1.Items.Clear(); int ProductId = int.Parse(e.Node.Name.Split('_')[1]); int STT = 0; float TongTien = 0; for (int i = 0; i < listOrderDetails.Count; i++) { if (listOrderDetails[i].ProductID == ProductId) { STT++; ListViewItem item = new ListViewItem(STT.ToString()); item.SubItems.Add(listOrderDetails[i].OrderID.ToString()); item.SubItems.Add(listOrderDetails[i].Quantity.ToString()); item.SubItems.Add(Converts.ChuyenDoiTienTeVietNam(listOrderDetails[i].UnitPrice)); item.SubItems.Add(Converts.ChuyenDoiTienTeVietNam(listOrderDetails[i].SubTotal)); this.listViewEx1.Items.Add(item); TongTien += listOrderDetails[i].SubTotal; } } this.lblThongKE.Text = "Tổng số lượng bán ra : " + STT + " , giúp thu vào : " + Converts.ChuyenDoiTienTeVietNam(TongTien); } }
/// <summary> /// WBS节点树鼠标点击事件 /// Created:20170406 (ChengMengjia) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void WbsTree_NodeMouseDown(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { IsRightClick = e.Button == System.Windows.Forms.MouseButtons.Right;//是否为右击事件 if (IsRightClick) { PNode node = JsonHelper.StringToEntity <PNode>(e.Node.Tag.ToString()); Point point = WbsTree.PointToClient(Cursor.Position); if (string.IsNullOrEmpty(node.ParentID)) { //顶级节点 this.EditProMenu.Show(WbsTree, point); } else { if (node.PType == 0) { this.toolNodeExchange.Text = "转为交付物"; } else if (node.PType == 1) { this.toolNodeExchange.Text = "转为节点"; } else { return; } this.EditNodeMenu.Tag = e.Node.Tag; this.EditNodeMenu.Show(WbsTree, point); } } }
private void tv_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { if (e.Node.Tag != null && e.Node.Tag.ToString().All(char.IsDigit)) { iID = Convert.ToInt32(e.Node.Tag); if (iID > 0) { Program.SQL.AddParameter("id", iID); DataSet ds = Program.SQL.SelectAll("SELECT * FROM schedules WHERE id=@id;"); if (ds.Tables.Count == 1 && ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; txtName.Text = dr["name"].ToString(); foreach (DevComponents.Editors.ComboItem i in cbxGrade.Items) { if (i.Value.ToString() == dr["grade"].ToString()) { cbxGrade.SelectedItem = i; break; } } if (dr["questions"] != DBNull.Value && dr["questions"].ToString().Length > 0) { string[] sQuestions = dr["questions"].ToString().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); if (sQuestions.Length > 0) { foreach (GridRow r in gQ.PrimaryGrid.Rows) { r.Checked = false; if (r.Tag != null && sQuestions.Contains(r.Tag.ToString())) { r.Checked = true; } } } } if (dr["notes"] != DBNull.Value && dr["notes"].ToString().Length > 0) { string[] sNotes = dr["notes"].ToString().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); if (sNotes.Length > 0) { foreach (GridRow r in gN.PrimaryGrid.Rows) { r.Checked = false; if (r.Tag != null && sNotes.Contains(r.Tag.ToString())) { r.Checked = true; } } } } } } } }
/// <summary> /// 点击树节点时,改变DATAGRID里的内容 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TreeLayer_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { //选择节点时,将上一次选择过的属性值赋值给它对应的节点 if (e.Node.Index >= 0) { TreeLayer.Nodes[Convert.ToInt32(dataGridViewX1.Tag)].Name = ""; for (int d = 0; d < dataGridViewX1.Rows.Count; d++) { if (Convert.ToBoolean(dataGridViewX1.Rows[d].Cells[0].Value) == true) { string temp = dataGridViewX1.Rows[d].Cells[1].Value.ToString(); TreeLayer.Nodes[Convert.ToInt32(dataGridViewX1.Tag)].Name += temp + " "; } } } //选择节点时,判别曾经是否有选择过 if (e.Node.Name != "") { #region 如果以前选择过,就让它对应的属性成选择的状态 ReadNode(e.Node); if (!e.Node.Checked) { e.Node.Name = ""; return; } string Name = e.Node.Name.Trim(); char[] sp = { ' ' }; string[] StrName = Name.Split(sp); for (int c = 0; c < dataGridViewX1.Rows.Count; c++) { for (int N = 0; N < StrName.Length; N++) { if (StrName[N] == dataGridViewX1.Rows[c].Cells[1].Value.ToString()) { dataGridViewX1.Rows[c].Cells[0].Value = true; break; } } } #endregion } else { #region 没有选择过,就根据节点上的层名读它对应的所有属性 if (e.Node.Checked) { dataGridViewX1.Columns[0].ReadOnly = false; } else { dataGridViewX1.Columns[0].ReadOnly = true; } ReadNode(e.Node); #endregion } }
private void treeList1_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { DevComponents.AdvTree.Node node = e.Node; if (node.Tag != null && TypeOfObject.IsInstanceOfType(node.Tag)) { CurrentSelectedNode = node; } }
private void AdvTree_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { if (e.Node.Name != "Root") { selectedNote = e.Node; FillUI(); ControlUI(true); } }
private void advTree1_NodeMouseUp(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { ProgList _mproglist = e.Node.Tag as ProgList; if (e.Button == System.Windows.Forms.MouseButtons.Left) { string _FrmName = string.Empty; if (!string.IsNullOrEmpty(_mproglist.Prog_Assmbly.Trim()))//程序集 { _FrmName = _mproglist.Prog_Assmbly.Trim() + "."; } if (!string.IsNullOrEmpty(_mproglist.Prog_NameSp.Trim()))//命名空间 { _FrmName += _mproglist.Prog_NameSp.Trim() + "."; } else { _FrmName += this.GetType().Namespace + "."; } if (string.IsNullOrEmpty(_mproglist.Prog_CLS.Trim())) { return; } else { _FrmName += _mproglist.Prog_CLS.Trim(); } bool CanNew = true; for (int i = 0; i < this.MdiChildren.Length; i++) { if (this.MdiChildren[i].Name == _FrmName) { CanNew = false; //this.MdiChildren[i].Focus(); this.MdiChildren[i].Activate(); break; } } if (!CanNew) { return; } Assembly assembly = Assembly.GetExecutingAssembly(); Form _frm = assembly.CreateInstance(_FrmName) as Form; _frm.Name = _FrmName; formCount++; _frm.MdiParent = this; _frm.Text = _mproglist.Prog_Descp; _frm.Show(); xtraTabbedMdiManager1.Pages[xtraTabbedMdiManager1.Pages.Count - 1].Appearance.Header.BackColor = TabColor[(formCount - 1) % 6]; } }
private void advTree1_NodeDoubleClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { try { bool selAll = (Control.ModifierKeys & Keys.Control) == Keys.Control; bool addToTemp = (Control.ModifierKeys & Keys.Shift) == Keys.Shift; SetListPaneSource(items[e.Node], selAll, addToTemp); } catch (Exception) { } }
private void advTree_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { try { IFeature pfeature = advTree.SelectedNode.Tag as IFeature; if (pfeature != null) { m_dataSourceGrid.Clear(); for (int i = 0; i < pfeature.Fields.FieldCount; i++) { if (pfeature.Fields.get_Field(i).Type == esriFieldType.esriFieldTypeGeometry) { string strGeometryType = ""; if (pfeature.FeatureType == esriFeatureType.esriFTSimple) { switch (pfeature.Shape.GeometryType) { case esriGeometryType.esriGeometryPoint: strGeometryType = "点"; break; case esriGeometryType.esriGeometryPolyline: strGeometryType = "线"; break; case esriGeometryType.esriGeometryPolygon: strGeometryType = "多边形"; break; } } else if (pfeature.FeatureType == esriFeatureType.esriFTAnnotation) { strGeometryType = "注记"; } if (string.IsNullOrEmpty(strGeometryType)) { strGeometryType = pfeature.Shape.GeometryType.ToString(); } m_dataSourceGrid.Rows.Add(new object[] { pfeature.Fields.get_Field(i).AliasName, strGeometryType }); } else { m_dataSourceGrid.Rows.Add(new object[] { pfeature.Fields.get_Field(i).AliasName, pfeature.get_Value(i) }); } } ModDBOperator.FlashFeature(pfeature, m_pMapControl); } } catch { } }
private void advTree_NodeDoubleClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { IFeature pfeature = advTree.SelectedNode.Tag as IFeature; if (pfeature != null) { SysCommon.Gis.ModGisPub.ZoomToFeature(m_pMapControl, pfeature); Application.DoEvents(); m_pMapControl.FlashShape(pfeature.Shape, 2, 500, null); } }
/// <summary> /// 用于设置修改之前的值 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void advTree1_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { for (int i = 0; i < advTree1.Nodes.Count; i++) { if (advTree1.Nodes[i].Name == e.Node.Name) { fvalue = advTree1.Nodes[i].Text; break; } } }
//private DevComponents.AdvTree.Node SelectNode(List<string> selectPath, int level, DevComponents.AdvTree.NodeCollection nodeCollection) //{ //} private void advTree1_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { //判斷是否有按Control,Shift bool SelectedAll = (Control.ModifierKeys & Keys.Control) == Keys.Control; bool AddToTemp = (Control.ModifierKeys & Keys.Shift) == Keys.Shift; //傳入ID if (e.Node.Tag is string) //如果是字串(是所有學生 or 班級名稱Node) { #region 當使用者是選取標頭(所有學生) if ("" + e.Node.Tag == "All") { SetListPaneSource(TestDic2.Keys, SelectedAll, AddToTemp); } else if (TestDic1.ContainsKey("" + e.Node.Tag)) //當使用者是選取班級名稱 { if (e.Node.Parent.Tag is int) //取得上層Node是否為學年度Node { int CountX = (int)e.Node.Parent.Tag; if (SchoolYearDic.ContainsKey(CountX)) { if (SchoolYearDic[CountX]._ClassNameList.ContainsKey("" + e.Node.Tag)) { SetListPaneSource(SchoolYearDic[CountX]._ClassNameList["" + e.Node.Tag].Select(x => x.UID), SelectedAll, AddToTemp); } } } } else //未選取 { } #endregion } else if (e.Node.Tag is int) { #region 如果是數字(是學年度Node) //取得該學年所有學生清單 List <string> ClassStudent = new List <string>(); int CountX = (int)e.Node.Tag; if (SchoolYearDic.ContainsKey(CountX)) { foreach (string each in SchoolYearDic[CountX]._ClassNameList.Keys) { List <string> list = SchoolYearDic[CountX]._ClassNameList[each].Select(x => x.UID).ToList(); ClassStudent.AddRange(list); } } SetListPaneSource(ClassStudent, SelectedAll, AddToTemp); #endregion } }
private void advTree1_NodeMouseUp(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { if (e.Button == System.Windows.Forms.MouseButtons.Left) { _Prog_WRT = e.Node.Tag as Prog_WRT; _SelectNode = e.Node; } else { _Prog_WRT = e.Node.Tag as Prog_WRT; _SelectNode = e.Node; popupMenu1.ShowPopup(MousePosition); } }
private void advTreeArea_NodeMouseDown(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { if (e.Button == System.Windows.Forms.MouseButtons.Left) { if (e.Node.Tag == null) { DoLoadByArea(null); } else { DoLoadByArea(GetSubAreas(e.Node)); } } }
private void advTree1_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { DevComponents.AdvTree.Node advTreeNode = e.Node; if (advTreeNode == nodeRoot) { return; } OneNode nodeTag = advTreeNode.Tag as OneNode; nodeCurrent = nodeTag; panelEx1.CurrentNode = nodeCurrent; UpdateStatus(); }
private void tv_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { switch (e.Node.TagString) { case "visual": pGeneral.Visible = false; pVisual.Visible = true; break; default: pGeneral.Visible = true; pVisual.Visible = false; break; } }
//双击树节点添加需要更新的字段 private void advTreeTableList_NodeDoubleClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { try { DataRow drData = dtData.NewRow(); drData[0] = e.Node.Tag.ToString(); drData[1] = newAttr[(int)Math.Round((double)(newAttr.Count - 1))]; dtData.Rows.Add(drData); this.dgvFieldsUpdate.DataSource = dtData; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// 双击节点,确定要保留的要素 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void treeview_Name_NodeDoubleClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { AttributeShow_state.doubleclick = true;//确定这个操作是双击定位,不影响要素变更 if (e.Node.Parent == null) { return; } else { layer_name = e.Node.Parent.Text; //层名 OID = e.Node.Text; //OID ControlsMerge.SavedOID = Convert.ToInt32(OID); //传出选择的要素 this.Close(); } }
private void advTree1_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { UpdateDef(); object obj = e.Node.Tag; if (obj is Parser.QuestionGroup) { showQuestionGroupDefinition((Parser.QuestionGroup)obj); showPreview((Parser.QuestionGroup)obj); } else { showQuestionDefinition((Parser.Question)obj); } }
private void deptTree_NodeMouseUp(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { if (e.Button == System.Windows.Forms.MouseButtons.Right) { ctxMenu.Show(Cursor.Position); } Maticsoft.Model.SMT_ORG_INFO info = e.Node.Tag as Maticsoft.Model.SMT_ORG_INFO; if (info != null) { tbSelectDeptPath.Text = e.Node.FullPath.Replace("<i><font color=\"#444444\">", "").Replace("</font></i>", ""); tbSelectDeptPath.Tag = info; tbDeptNo.Text = info.ORG_CODE; tbDeptName.Text = info.ORG_NAME; ShowRoles(info.ID); ShowUsers(info.ID, info.ORG_NAME); } }