Esempio n. 1
0
        private void PART_Tree_OnNodeChanged(object sender, DevExpress.Xpf.Grid.TreeList.TreeListNodeChangedEventArgs e)
        {
            if (e.ChangeType == NodeChangeType.Add)
            {
                ResourceBrowserItem item = e.Node.Content as ResourceBrowserItem;
                if (item == null)
                {
                    return;
                }

                if (item.Items.IsInvalid())
                {
                    try
                    {
                        if (System.IO.Directory.GetDirectories(item.FullPath).Any())
                        {
                            e.Node.IsExpandButtonVisible = DevExpress.Utils.DefaultBoolean.True;
                        }
                        else
                        {
                            e.Node.IsExpandButtonVisible = DevExpress.Utils.DefaultBoolean.False;
                        }
                    }
                    catch
                    {
                        e.Node.IsExpandButtonVisible = DevExpress.Utils.DefaultBoolean.True;
                    }
                }
                else
                {
                    e.Node.IsExpandButtonVisible = DevExpress.Utils.DefaultBoolean.True;
                }
            }
        }
 void view_NodeChanged(object sender, DevExpress.Xpf.Grid.TreeList.TreeListNodeChangedEventArgs e)
 {
     if (e.ChangeType == NodeChangeType.Add)
     {
         FileSystemItemModelBase item = e.Node.Content as FileSystemItemModelBase;
         if (item.ItemType == "File")
         {
             e.Node.IsExpandButtonVisible = DevExpress.Utils.DefaultBoolean.False;
         }
     }
 }
Esempio n. 3
0
 /// <summary>
 /// 节点改变时触发
 /// </summary>
 private void view_NodeChanged(object sender, DevExpress.Xpf.Grid.TreeList.TreeListNodeChangedEventArgs e)
 {
     if (All_OnNodeChanged != null)
     {
         All_OnNodeChanged(sender, e);
     }
     if (this.OnNodeChanged != null)
     {
         this.OnNodeChanged(sender, e);
     }
 }
Esempio n. 4
0
 private void TreeListView_NodeChanged(object sender, DevExpress.Xpf.Grid.TreeList.TreeListNodeChangedEventArgs e)
 {
     if (e.ChangeType == NodeChangeType.Add)
     {
         Dispatcher.BeginInvoke(new Action(() => {
             if (e.Node.ParentNode != null)
             {
                 e.Node.ParentNode.IsExpanded = true;
             }
         }));
     }
 }