public LibraryView(LibraryModel model, LibraryListView.Factory libraryListViewFactory, LibraryBookView.Factory templateBookViewFactory, SelectedTabChangedEvent selectedTabChangedEvent, SendReceiveCommand sendReceiveCommand) { _model = model; InitializeComponent(); _toolStrip.Renderer = new NoBorderToolStripRenderer(); _collectionListView = libraryListViewFactory(); _collectionListView.Dock = DockStyle.Fill; splitContainer1.Panel1.Controls.Add(_collectionListView); _bookView = templateBookViewFactory(); _bookView.Dock = DockStyle.Fill; splitContainer1.Panel2.Controls.Add(_bookView); splitContainer1.SplitterDistance = _collectionListView.PreferredWidth; _makeBloomPackButton.Visible = model.IsShellProject; _sendReceiveButton.Visible = Settings.Default.ShowSendReceive; _sendReceiveButton.Click += new EventHandler((x, y) => sendReceiveCommand.Raise(this)); _sendReceiveButton.Enabled = !SendReceiver.SendReceiveDisabled; ; selectedTabChangedEvent.Subscribe(c => { if (c.To == this) { Logger.WriteEvent("Entered Collections Tab"); } }); }
public LibraryView(LibraryModel model, LibraryListView.Factory libraryListViewFactory, LibraryBookView.Factory templateBookViewFactory, SelectedTabChangedEvent selectedTabChangedEvent, SendReceiveCommand sendReceiveCommand) { _model = model; InitializeComponent(); _toolStrip.Renderer = new NoBorderToolStripRenderer(); _collectionListView = libraryListViewFactory(); _collectionListView.Dock = DockStyle.Fill; splitContainer1.Panel1.Controls.Add(_collectionListView); _bookView = templateBookViewFactory(); _bookView.Dock = DockStyle.Fill; splitContainer1.Panel2.Controls.Add(_bookView); splitContainer1.SplitterDistance = _collectionListView.PreferredWidth; _makeBloomPackButton.Visible = model.IsShellProject; _sendReceiveButton.Visible = Settings.Default.ShowSendReceive; _sendReceiveButton.Click+=new EventHandler((x,y)=>sendReceiveCommand.Raise(this)); _sendReceiveButton.Enabled = !SendReceiver.SendReceiveDisabled; ; selectedTabChangedEvent.Subscribe(c=> { if (c.To == this) { Logger.WriteEvent("Entered Collections Tab"); } }); }
public LibraryView(LibraryModel model, LibraryListView.Factory libraryListViewFactory, LibraryBookView.Factory templateBookViewFactory, SelectedTabChangedEvent selectedTabChangedEvent, SendReceiveCommand sendReceiveCommand) { _model = model; InitializeComponent(); splitContainer1.BackColor = Palette.BookListSplitterColor; // controls the left vs. right splitter _toolStrip.Renderer = new NoBorderToolStripRenderer(); _collectionListView = libraryListViewFactory(); _collectionListView.Dock = DockStyle.Fill; splitContainer1.Panel1.Controls.Add(_collectionListView); _bookView = templateBookViewFactory(); _bookView.Dock = DockStyle.Fill; splitContainer1.Panel2.Controls.Add(_bookView); splitContainer1.SplitterDistance = _collectionListView.PreferredWidth; _makeBloomPackButton.Visible = model.IsShellProject; _sendReceiveButton.Visible = Settings.Default.ShowSendReceive; if (sendReceiveCommand != null) { #if Chorus _sendReceiveButton.Click += (x, y) => sendReceiveCommand.Raise(this); _sendReceiveButton.Enabled = !SendReceiver.SendReceiveDisabled; #endif } else { _sendReceiveButton.Enabled = false; } if (SIL.PlatformUtilities.Platform.IsMono) { BackgroundColorsForLinux(); } selectedTabChangedEvent.Subscribe(c => { if (c.To == this) { Logger.WriteEvent("Entered Collections Tab"); } }); }
//HistoryAndNotesDialog.Factory historyAndNotesDialogFactory) public LibraryListView(LibraryModel model, BookSelection bookSelection, SelectedTabChangedEvent selectedTabChangedEvent, LocalizationChangedEvent localizationChangedEvent) { _model = model; _bookSelection = bookSelection; localizationChangedEvent.Subscribe(unused=>LoadSourceCollectionButtons()); //_historyAndNotesDialogFactory = historyAndNotesDialogFactory; _buttonsNeedingSlowUpdate = new ConcurrentQueue<ButtonRefreshInfo>(); selectedTabChangedEvent.Subscribe(OnSelectedTabChanged); InitializeComponent(); _primaryCollectionFlow.HorizontalScroll.Visible = false; _primaryCollectionFlow.Controls.Clear(); _primaryCollectionFlow.HorizontalScroll.Visible = false; _sourceBooksFlow.Controls.Clear(); _sourceBooksFlow.HorizontalScroll.Visible = false; if (!_model.ShowSourceCollections) { splitContainer1.Panel2Collapsed = true; } _headerFont = new Font(SystemFonts.DialogFont.FontFamily, (float)10.0, FontStyle.Bold); _editableBookFont = new Font(SystemFonts.DialogFont.FontFamily, (float)9.0);//, FontStyle.Bold); _collectionBookFont = new Font(SystemFonts.DialogFont.FontFamily, (float)9.0); //enhance: move to model bookSelection.SelectionChanged += new EventHandler(OnBookSelectionChanged); _settingsProtectionHelper.ManageComponent(_openFolderOnDisk); _showHistoryMenu.Visible = _showNotesMenu.Visible = Settings.Default.ShowSendReceive; if(Settings.Default.ShowExperimentalCommands) _settingsProtectionHelper.ManageComponent(_exportToXMLForInDesignToolStripMenuItem);//we are restricting it because it opens a folder from which the user could do damage _exportToXMLForInDesignToolStripMenuItem.Visible = Settings.Default.ShowExperimentalCommands; SetupBookDropdownIcon(); _bookContextMenu.Closed += _bookContextMenu_Closed; _bookContextMenu.Opening += _bookContextMenu_Opening; }
public LibraryListView(LibraryModel model, BookSelection bookSelection, SelectedTabChangedEvent selectedTabChangedEvent, LocalizationChangedEvent localizationChangedEvent, HistoryAndNotesDialog.Factory historyAndNotesDialogFactory, BookTransfer bookTransferrer) { _model = model; _bookSelection = bookSelection; localizationChangedEvent.Subscribe(unused => LoadSourceCollectionButtons()); _historyAndNotesDialogFactory = historyAndNotesDialogFactory; _bookTransferrer = bookTransferrer; _buttonsNeedingSlowUpdate = new ConcurrentQueue <Button>(); selectedTabChangedEvent.Subscribe(OnSelectedTabChanged); InitializeComponent(); _primaryCollectionFlow.HorizontalScroll.Visible = false; _primaryCollectionFlow.Controls.Clear(); _primaryCollectionFlow.HorizontalScroll.Visible = false; _sourceBooksFlow.Controls.Clear(); _sourceBooksFlow.HorizontalScroll.Visible = false; if (!_model.ShowSourceCollections) { splitContainer1.Panel2Collapsed = true; } _headerFont = new Font(SystemFonts.DialogFont.FontFamily, (float)10.0, FontStyle.Bold); _editableBookFont = new Font(SystemFonts.DialogFont.FontFamily, (float)9.0); //, FontStyle.Bold); _collectionBookFont = new Font(SystemFonts.DialogFont.FontFamily, (float)9.0); //enhance: move to model bookSelection.SelectionChanged += new EventHandler(OnBookSelectionChanged); _settingsProtectionHelper.ManageComponent(_openFolderOnDisk); _showHistoryMenu.Visible = _showNotesMenu.Visible = Settings.Default.ShowSendReceive; if (Settings.Default.ShowExperimentalCommands) { _settingsProtectionHelper.ManageComponent(_exportToXMLForInDesignToolStripMenuItem); //we are restriting it because it opens a folder from which the user could do damage } _exportToXMLForInDesignToolStripMenuItem.Visible = Settings.Default.ShowExperimentalCommands; }
public LibraryView(LibraryModel model, LibraryListView.Factory libraryListViewFactory, LibraryBookView.Factory templateBookViewFactory, SelectedTabChangedEvent selectedTabChangedEvent, SendReceiveCommand sendReceiveCommand, TeamCollectionManager tcManager) { _model = model; InitializeComponent(); splitContainer1.BackColor = Palette.BookListSplitterColor; // controls the left vs. right splitter _toolStrip.Renderer = new NoBorderToolStripRenderer(); _toolStripLeft.Renderer = new NoBorderToolStripRenderer(); _collectionListView = libraryListViewFactory(); _collectionListView.Dock = DockStyle.Fill; splitContainer1.Panel1.Controls.Add(_collectionListView); _bookView = templateBookViewFactory(); _bookView.TeamCollectionMgr = tcManager; _bookView.Dock = DockStyle.Fill; splitContainer1.Panel2.Controls.Add(_bookView); // When going down to Shrink Stage 3 (see WorkspaceView), we want the right-side toolstrip to take precedence // (Settings, Other Collection). // This essentially makes the TC Status button's zIndex less than the buttons on the right side. _toolStripLeft.SendToBack(); splitContainer1.SplitterDistance = _collectionListView.PreferredWidth; _makeBloomPackButton.Visible = model.IsShellProject; _sendReceiveButton.Visible = Settings.Default.ShowSendReceive; if (sendReceiveCommand != null) { #if Chorus _sendReceiveButton.Click += (x, y) => sendReceiveCommand.Raise(this); _sendReceiveButton.Enabled = !SendReceiver.SendReceiveDisabled; #endif } else { _sendReceiveButton.Enabled = false; } if (SIL.PlatformUtilities.Platform.IsMono) { BackgroundColorsForLinux(); } selectedTabChangedEvent.Subscribe(c => { if (c.To == this) { Logger.WriteEvent("Entered Collections Tab"); } }); SetTeamCollectionStatus(tcManager); TeamCollectionManager.TeamCollectionStatusChanged += (sender, args) => { if (IsHandleCreated && !IsDisposed) { SafeInvoke.InvokeIfPossible("update TC status", this, false, () => SetTeamCollectionStatus(tcManager)); } }; _tcStatusButton.Click += (sender, args) => { // Any messages for which reloading the collection is a useful action? var showReloadButton = tcManager.MessageLog.ShouldShowReloadButton; // Reinstate this to see messages from before we started up. // We think it might be too expensive to show a list as long as this might get. // Instead, in the short term we may add a button to show the file. // Later we may implement some efficient way to scroll through them. // tcManager.CurrentCollection?.MessageLog?.LoadSavedMessages(); using (var dlg = new ReactDialog("teamCollectionDialogBundle", new { showReloadButton }, "Team Collection")) { dlg.ShowDialog(this); tcManager.CurrentCollectionEvenIfDisconnected?.MessageLog.WriteMilestone(MessageAndMilestoneType .LogDisplayed); } }; }
public ReactCollectionTabView(LibraryModel model, LibraryListView.Factory libraryListViewFactory, LibraryBookView.Factory templateBookViewFactory, SelectedTabChangedEvent selectedTabChangedEvent, SendReceiveCommand sendReceiveCommand, TeamCollectionManager tcManager) { _model = model; InitializeComponent(); BackColor = _reactControl.BackColor = Palette.GeneralBackground; _toolStrip.Renderer = new NoBorderToolStripRenderer(); _toolStripLeft.Renderer = new NoBorderToolStripRenderer(); // When going down to Shrink Stage 3 (see WorkspaceView), we want the right-side toolstrip to take precedence // (Settings, Other Collection). // This essentially makes the TC Status button's zIndex less than the buttons on the right side. _toolStripLeft.SendToBack(); //TODO splitContainer1.SplitterDistance = _collectionListView.PreferredWidth; _makeBloomPackButton.Visible = model.IsShellProject; _sendReceiveButton.Visible = Settings.Default.ShowSendReceive; if (sendReceiveCommand != null) { #if Chorus _sendReceiveButton.Click += (x, y) => sendReceiveCommand.Raise(this); _sendReceiveButton.Enabled = !SendReceiver.SendReceiveDisabled; #endif } else { _sendReceiveButton.Enabled = false; } if (SIL.PlatformUtilities.Platform.IsMono) { BackgroundColorsForLinux(); } selectedTabChangedEvent.Subscribe(c => { if (c.To == this) { Logger.WriteEvent("Entered Collections Tab"); } }); SetTeamCollectionStatus(tcManager); TeamCollectionManager.TeamCollectionStatusChanged += (sender, args) => { return; if (!IsDisposed) { SafeInvoke.InvokeIfPossible("update TC status", this, false, () => SetTeamCollectionStatus(tcManager)); } }; _tcStatusButton.Click += (sender, args) => { // Any messages for which reloading the collection is a useful action? var showReloadButton = tcManager.MessageLog.ShouldShowReloadButton; // Reinstate this to see messages from before we started up. // We think it might be too expensive to show a list as long as this might get. // Instead, in the short term we may add a button to show the file. // Later we may implement some efficient way to scroll through them. // tcManager.CurrentCollection?.MessageLog?.LoadSavedMessages(); using (var dlg = new ReactDialog("teamCollectionDialog", new { showReloadButton })) { dlg.ShowDialog(this); tcManager.CurrentCollectionEvenIfDisconnected?.MessageLog.WriteMilestone(MessageAndMilestoneType.LogDisplayed); } }; // We don't want this control initializing until team collections sync (if any) is done. // That could change, but for now we're not trying to handle async changes arriving from // the TC to the local collection, and as part of that, the collection tab doesn't expect // the local collection to change because of TC stuff once it starts loading. Controls.Remove(_reactControl); }