コード例 #1
0
ファイル: ImportedBooks.cs プロジェクト: sillsdev/WorldPad
		/// ------------------------------------------------------------------------------------
		/// <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);
		}
コード例 #2
0
ファイル: ImportedBooks.cs プロジェクト: bbriggs/FieldWorks
		/// ------------------------------------------------------------------------------------
		/// <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);
		}