Ejemplo n.º 1
0
        private void FileTreeView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            TreeListItem item = WpfUtil.GetTreeListItem(e.OriginalSource);

            if (item == null)
            {
                return;
            }

            FileComponent file = FileController.SelectedItem;

            if (file != null)
            {
                if (file.File)
                {
                    file.Open();
                }
                else
                {
                    TreeNode node = FileTreeView.SelectedNode;
                    if (node != null)
                    {
                        FileTreeView.SetIsExpanded(node, !node.IsExpanded);
                    }
                }
            }

            FileTreeView.UnselectAll();
        }
Ejemplo n.º 2
0
        private void FileOpenCommand_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            if (FileController.SelectedItems.Count == 1)
            {
                FileComponent file = FileController.SelectedItem;

                if (file.File)
                {
                    file.Open();
                    FileTreeView.UnselectAll();
                    return;
                }
            }

            FileController.Open(FileController.SelectedItems);
            FileTreeView.UnselectAll();
        }