Ejemplo n.º 1
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="T:DiffViewProxy"/> class.
		/// </summary>
		/// <param name="dlg">The instance of the DiffDialog displaying this view.</param>
		/// <param name="name">The (internal) name of the view.</param>
		/// <param name="book">The book to display.</param>
		/// <param name="fRev"><c>true</c> if this proxy is for the side representing the saved
		/// or imported version</param>
		/// ------------------------------------------------------------------------------------
		internal DiffViewProxy(DiffDialog dlg, string name, IScrBook book, bool fRev)
			: base(name, false)
		{
			m_dlg = dlg;
			m_book = book;
			m_fIsRevision = fRev;
		}
Ejemplo n.º 2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="T:DiffViewScrProxy"/> class.
		/// </summary>
		/// <param name="dlg">The instance of the DiffDialog displaying this view.</param>
		/// <param name="name">The (internal) name of the view.</param>
		/// <param name="book">The book to display.</param>
		/// <param name="fRev"><c>true</c> if this proxy is for the side representing the saved
		/// or imported version</param>
		/// ------------------------------------------------------------------------------------
		public DiffViewScrProxy(DiffDialog dlg, string name, IScrBook book, bool fRev)
			: base(dlg, name, book, fRev)
		{
		}
Ejemplo n.º 3
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Handles the Click event of the btnCompare control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event
		/// data.</param>
		/// ------------------------------------------------------------------------------------
		private void btnCompare_Click(object sender, EventArgs e)
		{
			BookMerger bookMerger = CurrentBookMerger;
			if (bookMerger == null || bookMerger.BookCurr == null || bookMerger.NumberOfDifferences == 0)
				return;

			MakeBackupIfNeeded(bookMerger);

			using (DiffDialog dlg = new DiffDialog(bookMerger, m_cache, m_styleSheet,
				m_zoomPercentageDraft, m_zoomPercentageFootnote, false))
			{
				dlg.ShowDialog();
			}
			UpdateDiffCount(lstImportedBooks.SelectedItems[0], bookMerger);
			lstBooksToMerge_SelectedIndexChanged(null, null);
		}
Ejemplo n.º 4
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Handles the Click event of the btnCompare control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event
		/// data.</param>
		/// ------------------------------------------------------------------------------------
		private void btnCompare_Click(object sender, EventArgs e)
		{
			BookMerger bookMerger = CurrentBookMerger;
			if (bookMerger == null || bookMerger.BookCurr == null || bookMerger.NumberOfDifferences == 0)
				return;

			using (UndoableUnitOfWorkHelper undoHelper = new UndoableUnitOfWorkHelper(
				m_cache.ServiceLocator.GetInstance<IActionHandler>(), "You should not see this Backup",
				"You should not see this Backup"))
			{
				MakeBackupIfNeeded(bookMerger);
				undoHelper.RollBack = false;
			}

			using (DiffDialog dlg = new DiffDialog(bookMerger, m_cache, m_styleSheet,
				m_zoomPercentageDraft, m_zoomPercentageFootnote, false, m_app, m_helpTopicProvider))
			{
				dlg.ShowDialog();
			}

			UpdateDiffCount(lstImportedBooks.SelectedItems[0], bookMerger);
			lstBooksToMerge_SelectedIndexChanged(null, null);
		}