public CloudCommunities(getTargetDel getTargetFn, closeContextMenuDel closeContextMenuFn, FolderBrowser exPane) { this.getTarget = getTargetFn; this.closeContextMenu = closeContextMenuFn; if (exPane != null) { this.explorePane = exPane; } else { this.explorePane = new FolderBrowser(); } this.addToCommunityToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.newCommunityToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.shareOnFacebookMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.shareOnFacebookMenuItem.Name = "shareOnFacebookMenuItem"; this.shareOnFacebookMenuItem.Size = new System.Drawing.Size(164, 22); this.shareOnFacebookMenuItem.Text = Language.GetLocalizedText(-1, "Share on Facebook"); this.shareOnFacebookMenuItem.Click += new EventHandler(shareOnFacebookMenuItem_Click); this.newCommunityToolStripMenuItem.Name = "newCommunityToolStripMenuItem"; this.newCommunityToolStripMenuItem.Size = new System.Drawing.Size(164, 22); this.newCommunityToolStripMenuItem.Text = Language.GetLocalizedText(-1, "New Community..."); this.addToCommunityToolStripMenuItem.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { this.newCommunityToolStripMenuItem }); this.addToCommunityToolStripMenuItem.Name = "addToCommunityToolStripMenuItem"; this.addToCommunityToolStripMenuItem.Size = new System.Drawing.Size(224, 22); this.addToCommunityToolStripMenuItem.Text = Language.GetLocalizedText(-1, "Add to Community"); this.addToCommunityToolStripMenuItem.DropDownOpening += new System.EventHandler(this.addToCommunityToolStripMenuItem_DropDownOpening); this.addToCommunityToolStripMenuItem.Click += new System.EventHandler(this.addToCommunityToolStripMenuItem_Click); }
void SetAppMode(ApplicationMode mode) { if (ProjectorServer || NoUi) { return; } this.SuspendLayout(); if (mode != currentMode) { switch (currentMode) { case ApplicationMode.Search: { if (searchPane != null) { searchPane.Hide(); } } break; case ApplicationMode.Tours: { if (toursTab != null) { toursTab.Hide(); } } break; case ApplicationMode.Explore: { if (explorePane != null) { explorePane.Hide(); } } break; case ApplicationMode.Community: { if (communitiesPane != null) { communitiesPane.Hide(); } } break; case ApplicationMode.View: { if (viewPane != null) { viewPane.Hide(); } } break; case ApplicationMode.Settings: { if (settingsPane != null) { settingsPane.Hide(); } } break; case ApplicationMode.Telescope: { if (telescopePane != null) { telescopePane.Hide(); } } break; case ApplicationMode.Tour1: case ApplicationMode.Tour2: case ApplicationMode.Tour3: case ApplicationMode.Tour4: case ApplicationMode.Tour5: { if (tourEdit != null) { tourEdit.Hide(); } } break; } } currentMode = mode; bool loadTours = false; switch (mode) { case ApplicationMode.Tours: { if (toursTab == null) { toursTab = new FolderBrowser(); toursTab.Owner = this; loadTours = true; } ShowPane(toursTab); } break; case ApplicationMode.Community: { if (communitiesPane == null) { communitiesPane = new FolderBrowser(); communitiesPane.SetCommunitiesMode(); communitiesPane.Owner = this; ShowPane(communitiesPane); communitiesPane.Refresh(); communitiesPane.LoadCommunities(); } else { ShowPane(communitiesPane); } } break; case ApplicationMode.View: { if (viewPane == null) { viewPane = new View(); viewPane.Owner = this; } ShowPane(viewPane); } break; case ApplicationMode.Settings: { if (settingsPane == null) { settingsPane = new SettingsTab(); settingsPane.Owner = this; } ShowPane(settingsPane); } break; case ApplicationMode.Telescope: { if (telescopePane == null) { telescopePane = new TelescopeTab(); telescopePane.Owner = this; } ShowPane(telescopePane); } break; case ApplicationMode.Explore: { if (explorePane == null) { explorePane = new FolderBrowser(); explorePane.ShowMyFolders = true; explorePane.SetExploreMode(); explorePane.LoadRootFoder(explorerRoot); explorePane.Owner = this; } ShowPane(explorePane); } break; case ApplicationMode.Search: { if (searchPane == null) { searchPane = new Search(); searchPane.Owner = this; } ShowPane(searchPane); } break; case ApplicationMode.Tour1: case ApplicationMode.Tour2: case ApplicationMode.Tour3: case ApplicationMode.Tour4: case ApplicationMode.Tour5: { if (figureEditor != null) { figureEditor.SaveAndClose(); } if (menuTabs.CurrentTour != null) { if (tourEdit == null) { tourEdit = new TourEditTab(); tourEdit.Owner = this; } if (tourEdit.Tour != menuTabs.CurrentTour) { tourEdit.Tour = menuTabs.CurrentTour; } ShowPane(tourEdit); if (tourEdit.Tour.EditMode && !TourPlayer.Playing) { uiController = tourEdit.TourEditorUI; } TimeLine.SetTour(tourEdit.Tour); } } break; } ShowContextPanel(); if (imageStackVisible) { ShowImageStack(); } ResumeLayout(true); if (Properties.Settings.Default.ShowLayerManager) { ShowLayersWindow(); } if (figureEditor != null) { ShowFiguresEditorWindow(); } if (currentTab != null) { currentTab.SetOpacity(); } if (loadTours) { toursTab.LoadTours(); } ClearClientArea = this.ClientRectangle; if (Properties.Settings.Default.TranparentWindows) { int widthUsed = 0; if (Properties.Settings.Default.ShowLayerManager) { widthUsed += layerManager.Width; } ClearClientArea.Height -= (currentTab.Height + contextPanel.Height); ClearClientArea.Width -= widthUsed; ClearClientArea.Location = new Point(ClearClientArea.Location.X + widthUsed, ClearClientArea.Location.Y + currentTab.Height); } if (this.WindowState != FormWindowState.Minimized) { KeyFramer.ShowZOrder(); } }