Ejemplo n.º 1
0
        /// When User Switch Notebook Viewer Page,
        /// This Method Catch event and if page is Folder Viewer object
        /// Do Folder Refresh & set menu/toolbar actions.
        /// Else if isn't Folder Viewer object
        /// setup toolbar & menu action (On/Off GoUp, GoHome, ecc)
        private void OnSwitchPage(object o, SwitchPageArgs args)
        {
            Gtk.Application.Invoke(delegate {
                Gtk.Widget page = notebookViewer.GetNthPage((int)args.PageNum);
                Type objType    = page.GetType();
                if (objType != typeof(FolderViewer))
                {
                    // NetworkViewer or Custom
                    SetSensitiveGoUpMenu(false);
                    SetSensitiveGoHomeMenu(false);
                }
                else
                {
                    // Folder Viewer
                    FolderViewer folderViewer = page as FolderViewer;
                    folderViewer.Refresh();

                    bool canGoUp = folderViewer.CanGoUp();
                    SetSensitiveGoUpMenu(canGoUp);
                    SetSensitiveGoHomeMenu(true);
                }

                // Set Sensitive Refresh Menu
                SetSensitiveRefreshMenu(objType.IsSubclassOf(typeof(RefreshableViewer)));
            });
        }
Ejemplo n.º 2
0
 public void FolderViewerRefresh()
 {
     // Skif Network Viewer
     if (this.notebookViewer.CurrentPage == 0)
     {
         NetworkViewer nv = notebookViewer.CurrentPageWidget as NetworkViewer;
         nv.Refresh();
     }
     else
     {
         // Go Up
         FolderViewer fv = notebookViewer.CurrentPageWidget as FolderViewer;
         fv.Refresh();
     }
 }