示例#1
0
        private void BrowseTreeView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            TreeListItem item = WpfUtil.GetTreeListItem(e.OriginalSource);

            if (item == null)
            {
                return;
            }

            BrowseComponent browse = BrowseController.SelectedItem;

            if (browse != null)
            {
                if (browse.File)
                {
                    DownloadController.Download(browse);
                }
                else
                {
                    TreeNode node = BrowseTreeView.SelectedNode;

                    if (node != null)
                    {
                        if (Application.Current != null)
                        {
                            Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Send, new Action(delegate
                            {
                                BrowseTreeView.SetIsExpanded(node, !node.IsExpanded);
                            }));
                        }
                    }
                }
            }

            BrowseTreeView.UnselectAll();
        }
示例#2
0
 private void BrowseDownloadCommand_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     BrowseController.Download(BrowseController.SelectedItems);
     BrowseTreeView.UnselectAll();
 }