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);
        }
示例#2
0
 public void set_Text(string codeToLoad, string extension, bool createMethodStream)
 {
     if (createMethodStream)
     {
         loadFile(codeToLoad.saveWithExtension(extension));
     }
     else
     {
         CodeViewer.set_Text(codeToLoad, extension);
     }
 }