Ejemplo n.º 1
0
 private void OISTree_BeforeExpand(object sender, DevComponents.AdvTree.AdvTreeNodeCancelEventArgs e)
 {
     /*
      * Node parent = e.Node;
      * if (parent.Nodes.Count > 0)
      *  return;
      *
      * //取得選取的OIS資料
      * Com_PartOperation singleComPartOperation = new Com_PartOperation();
      * foreach (Com_PartOperation i in listComPartOperation)
      * {
      *  if (i.operation1 != parent.Cells[0].Text)
      *      continue;
      *
      *  singleComPartOperation = i;
      * }
      *
      * //填入此OIS相關資料
      * status = cGetOISData.InsertDimenData(singleComPartOperation, parent);
      * if (!status)
      * {
      *  MessageBox.Show("製程資料取得失敗,請聯繫開發工程師");
      *  this.Close();
      * }
      */
 }
Ejemplo n.º 2
0
        private void fileExplorer_BeforeExpand(object sender, DevComponents.AdvTree.AdvTreeNodeCancelEventArgs e)
        {
            Node parent = e.Node;

            if (parent.Nodes.Count > 0)
            {
                if (toRefresh)
                {
                    parent.Nodes.Clear();
                }
                else
                {
                    return;
                }
            }

            toRefresh = false;
            if (parent.Tag is DInfo)
            {
                explorerTree.BeginUpdate();
                DInfo driveInfo = (DInfo)parent.Tag;
                LoadDirectories(parent, driveInfo.dir);
                parent.ExpandVisibility = eNodeExpandVisibility.Auto;
                explorerTree.EndUpdate(true);
            }
            else if (parent.Tag is DirectoryInfo)
            {
                LoadDirectories(parent, (DirectoryInfo)parent.Tag);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Adds new object to the collection and provides information about the source of the command
        /// </summary>
        /// <param name="node">Node to add</param>
        /// <param name="action">Source action</param>
        /// <returns></returns>
        public override int Add(Node node, eTreeAction action)
        {
            if (this.List.Contains(node)) return -1;

            if (TreeSelectionControl.MultiSelect)
            {
                if (TreeSelectionControl.MultiSelectRule == eMultiSelectRule.SameParent && this.Count>0)
                {
                    if (this[0].Parent != node.Parent)
                        throw new InvalidOperationException("Node being added does not belong to the same parent as currently selected nodes. See AdvTree.MultiSelectRule property");
                }
                if (!SuspendEvents)
                {
                    AdvTreeNodeCancelEventArgs cancelArgs = new AdvTreeNodeCancelEventArgs(action, node);
                    TreeSelectionControl.InvokeOnBeforeNodeSelect(cancelArgs);
                    if (cancelArgs.Cancel)
                        return -1;
                }
            }
            return base.Add(node, action);
        }
Ejemplo n.º 4
0
 private void TreeBeforeNodeSelect(object sender, AdvTreeNodeCancelEventArgs e)
 {
     if (SelectionChanging != null)
         SelectionChanging(this, e);
 }
Ejemplo n.º 5
0
        void PropertyTreeBeforeNodeSelect(object sender, AdvTreeNodeCancelEventArgs e)
        {
            PropertyNode propertyNode = _PropertyTree.SelectedNode as PropertyNode;
            if (propertyNode == null) return;

            if (propertyNode.IsEditing)
            {
                if (!propertyNode.ApplyEdit())
                    e.Cancel = true;
            }
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Raises SelectionChanging event.
 /// </summary>
 /// <param name="e">Provides event arguments.</param>
 protected virtual void OnSelectionChanging(AdvTreeNodeCancelEventArgs e)
 {
     AdvTreeNodeCancelEventHandler handler = SelectionChanging;
     if (handler != null)
         handler(this, e);
 }
Ejemplo n.º 7
0
 private void TreeBeforeNodeSelect(object sender, AdvTreeNodeCancelEventArgs e)
 {
     OnSelectionChanging(e);
 }
Ejemplo n.º 8
0
 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;
     //    }
     //}
 }
Ejemplo n.º 9
0
 /// <summary>
 /// 选择树结点之前
 /// </summary>
 /// <param name="sender">事件发送者</param>
 /// <param name="e">事件参数</param>
 private void guideTree_BeforeNodeSelect(object sender, AdvTreeNodeCancelEventArgs e)
 {
     SaveRecord();
 }
Ejemplo n.º 10
0
 private void treeFiles_BeforeNodeSelect(object sender, AdvTreeNodeCancelEventArgs e)
 {
     SaveCurrent();
 }
Ejemplo n.º 11
0
        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();
                }
            }
        }
Ejemplo n.º 12
0
 private void treeList_BeforeExpand(object sender, AdvTreeNodeCancelEventArgs e)
 {
     if (e.Node.Nodes.Count == 1 && e.Node.Nodes[0].Tag.GetType() == typeof (string) &&
         (string) e.Node.Nodes[0].Tag == "LAZY")
     {
         LazyLoadNodes(e.Node);
     }
 }