public ascx_FolderView buildGui()
        {
            var topPanel = this.clear().add_Panel();

            CodeViewer = topPanel.title(Title_CodeEditor).add_SourceCodeViewer();
            FolderView = topPanel.insert_Left(SplitterDistance, Title_FolderView).add_TreeView();

            FolderView.afterSelect <string>(
                (fileOrFolder) => {
                if (fileOrFolder.fileExists())
                {
                    CodeViewer.open(fileOrFolder);
                }
            });

            FolderView.beforeExpand <string>((treeNode, path) => loadFolder(treeNode, path));

            FolderView.onDrop((fileOrfolder) => {
                FolderView.clear();
                if (fileOrfolder.dirExists())
                {
                    loadFolder(FolderView.rootNode(), fileOrfolder);
                }
            });
            FolderView.add_ContextMenu()
            .add_MenuItem("Refresh", true, () => refresh())
            .add_MenuItem("Open in Windows Explorer",
                          () => FolderView.selected().get_Tag().str().startProcess());

            CodeViewer.set_Text("....select file on the left to view its contents here...");
            return(this);
        }
Example #2
0
        public void buildGui()
        {
            CodeViewer = this.add_SourceCodeViewer();
            FolderView = CodeViewer.insert_Left().add_TreeView();

            FolderView.afterSelect <string>(
                (fileOrFolder) => {
                if (fileOrFolder.fileExists())
                {
                    CodeViewer.open(fileOrFolder);
                }
            });

            FolderView.beforeExpand <string>((treeNode, path) => loadFolder(treeNode, path));

            FolderView.onDrop((fileOrfolder) => {
                FolderView.clear();
                if (fileOrfolder.dirExists())
                {
                    loadFolder(FolderView.rootNode(), fileOrfolder);
                }
            });
            FolderView.add_ContextMenu()
            .add_MenuItem("Refresh", true, () => refresh())
            .add_MenuItem("Open in Windows Explorer",
                          () => FolderView.selected().get_Tag().str().startProcess());

            CodeViewer.set_Text("....select file on the left to view its contents here...");
        }