Exemplo n.º 1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="explorer"></param>
        /// <param name="parent"></param>
        /// <param name="path"></param>
        public FolderTreeNode(FolderExplorerComponent explorer, FolderTreeNode parent, Path path)
        {
            _explorer = explorer;
            _parent   = parent;
            _subTree  = new Tree <FolderTreeNode>(GetBinding(_explorer));

            // always start with container folder
            SetFolder(new ContainerFolder(path, true));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructs a tree item binding.
        /// </summary>
        /// <param name="explorer"></param>
        /// <returns></returns>
        private static TreeItemBinding <FolderTreeNode> GetBinding(FolderExplorerComponent explorer)
        {
            var binding = new TreeItemBinding <FolderTreeNode>
            {
                NodeTextProvider         = node => node.Folder.Text,
                IconSetProvider          = node => node.Folder.IconSet,
                TooltipTextProvider      = node => node.Folder.Tooltip,
                ResourceResolverProvider = node => node.Folder.ResourceResolver,
                CanAcceptDropHandler     = explorer.CanFolderAcceptDrop,
                AcceptDropHandler        = explorer.FolderAcceptDrop,
                CanHaveSubTreeHandler    = node => node.CanHaveSubTree,
                IsExpandedGetter         = node => node.Expanded,
                IsExpandedSetter         = (node, expanded) => node.Expanded = expanded,
                SubTreeProvider          = node => node.GetSubTree()
            };

            return(binding);
        }
Exemplo n.º 3
0
        private void BuildFolderExplorers()
        {
            var folderSystems = FolderExplorerComponentSettings.Default.ApplyFolderSystemsOrder(_folderSystems);

            // create a folder explorer component and a tab page for each folder system
            foreach (var folderSystem in folderSystems)
            {
                IFolderExplorerComponent explorer = new FolderExplorerComponent(folderSystem, this);
                explorer.Initialized           += FolderSystemInitializedEventHandler;
                explorer.SelectedFolderChanged += OnSelectedFolderChanged;

                folderSystem.SetContext(new FolderSystemContext(this, explorer, _contentComponent));
                folderSystem.TitleChanged     += FolderSystemTitleChangedEventHandler;
                folderSystem.TitleIconChanged += FolderSystemIconChangedEventHandler;

                var page = CreatePageForFolderExplorer(explorer);
                _folderExplorerComponents.Add(folderSystem, (FolderExplorerComponent)page.Component);
                _stackTabComponent.Pages.Add(page);
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="explorer"></param>
 public FolderTreeRoot(FolderExplorerComponent explorer)
     : base(explorer, null, new Path("", null))
 {
 }