/// <summary> /// Called when a grid row is double clicked (event handler for event raised in FolderDisplay class) /// </summary> /// <param name="sender">FolderDisplay object that raised the event</param> /// <param name="e">Event arguments for the event</param> protected void OnGridClicked(object sender, EventArgs e) { FolderDisplayEvent fde = (FolderDisplayEvent)e; //check the fde.fileInfo and fde.folderData to see which to do if (fde.fileInfo != null) { updateSidebar(); } else { //open another panel FolderDisplay fds = (FolderDisplay)sender; //clear the list as needed clearTableToLevel(fds.level); //display the new folder display and register click handler FolderDisplay sub = new FolderDisplay(fde.folderData, fds.level + 1); addToTable(sub); sub.GridClicked += OnGridClicked; sub.GridSingleClick += onSingleClick; sub.GridKeys += onGridKey; } }
/// <summary> /// Called when a row in the grid is single clicked (for updating the sidebar) /// </summary> /// <param name="sender">FolderDisplay object that raised the event</param> /// <param name="e">Event arguments for the event</param> protected void onSingleClick(object sender, EventArgs e) { FolderDisplayEvent fde = (FolderDisplayEvent)e; //update the sidebarPath (folder or file?) if (fde.fileInfo != null) { sidebarPath = fde.fileInfo.FullName; } else { sidebarPath = fde.folderData.path.FullName; sidebarFolder = fde.folderData; } //redraw the sidebar updateSidebar(); }