private void localVariableList_BeforeExpand(object sender, AdvTreeNodeCancelEventArgs e) { //if (IsPopulated) //{ // if (!PopulatedCollectionNodes.Contains(e.Node)) // { // Cursor = Cursors.WaitCursor; // AddChildrenToTreeview(e.Node.Tag as LocalVariableInformation, e.Node); // Cursor = Cursors.Default; // } //} }
private void m_assetFolderTree_BeforeExpand(object sender, AdvTreeNodeCancelEventArgs e) { Node parent = e.Node; if (parent.Nodes.Count > 0) { return; } if (parent.Tag is DirectoryInfo) { LoadDirectories(parent, (DirectoryInfo)parent.Tag, false); } }
//(註解)點選"+"的時候 private void advTree1_BeforeExpand(object sender, AdvTreeNodeCancelEventArgs e) { /* * try * { * Node parent = e.Node; * if (parent.Nodes.Count > 0) return; * * NXOpen.Assemblies.Component clickComp = (NXOpen.Assemblies.Component)parent.Tag; * List<NXOpen.Assemblies.Component> compAry = new List<NXOpen.Assemblies.Component>(); * status = CaxAsm.GetCompChildren(clickComp, ref compAry, false); * if (!status) * { * MessageBox.Show("尋找子Component失敗,請聯繫開發工程師"); * this.Close(); * } * * //判斷搜出來的子comp是否還有他的子comp,如果有就加入"+"符號,如果沒有表示最後一階層 * List<NXOpen.Assemblies.Component> childrenCompAry = new List<NXOpen.Assemblies.Component>(); * foreach (NXOpen.Assemblies.Component i in compAry) * { * childrenCompAry = new List<NXOpen.Assemblies.Component>(); * CaxAsm.GetCompChildren(i, ref childrenCompAry, false); * if (childrenCompAry.Count > 0) * { * status = InsertSubComponent(parent, i, true); * if (!status) * { * MessageBox.Show("插入子Component失敗,請聯繫開發工程師"); * this.Close(); * } * } * else * { * status = InsertSubComponent(parent, i, false); * if (!status) * { * MessageBox.Show("插入子Component失敗,請聯繫開發工程師"); * this.Close(); * } * } * } * } * catch (System.Exception ex) * { * MessageBox.Show(ex.ToString()); * } */ }
private void comboTree1_SelectionChanging(object sender, AdvTreeNodeCancelEventArgs e) { e.Cancel = (e.Node != null && e.Node.Tag == null); if (e.Cancel) { if (e.Node != null && e.Action != eTreeAction.Code) { e.Node.Toggle(eTreeAction.Code); } if (comboTree1.SelectedNode != null && comboTree1.SelectedNode.Parent != null && !comboTree1.SelectedNode.Parent.Expanded) { comboTree1.SelectedNode = null; } } }
private void advTree1_BeforeExpand(object sender, AdvTreeNodeCancelEventArgs e) { Node parent = e.Node; if (parent.Nodes.Count > 0) { return; } if (parent.Tag is DriveInfo) { advTree1.BeginUpdate(); DriveInfo driveInfo = (DriveInfo)parent.Tag; LoadDirectories(parent, driveInfo.RootDirectory); parent.ExpandVisibility = eNodeExpandVisibility.Auto; advTree1.EndUpdate(true); } else if (parent.Tag is DirectoryInfo) { LoadDirectories(parent, (DirectoryInfo)parent.Tag); } }
private void advTreeGroup_BeforeExpand(object sender, AdvTreeNodeCancelEventArgs e) { Node nodeParent = e.Node; nodeParent.Nodes.Clear(); AscmWipDiscreteJobs ascmGetMaterialTask = nodeParent.Tag as AscmWipDiscreteJobs; if (ascmGetMaterialTask != null) { //Structure nodes columns StructureAdvTreeSecondLevelColumns(nodeParent); //Get discretejobs list List <AscmWipRequirementOperations> list = DataBindAdvTreeSecondLevelNode(ascmGetMaterialTask.wipEntityId, ascmGetMaterialTask.mtlCategoryStatus); if (list != null && list.Count > 0) { advTreeGroup.BeginInit(); StrucureAdvTreeSecondLevelNode(list, nodeParent); advTreeGroup.EndInit(); } } }
/// <summary> /// 选择树结点之前 /// </summary> /// <param name="sender">事件发送者</param> /// <param name="e">事件参数</param> private void guideTree_BeforeNodeSelect(object sender, AdvTreeNodeCancelEventArgs e) { SaveRecord(); }