Ejemplo n.º 1
0
		/// <summary/>
		public void ShowSummaryDialog(IWin32Window owner, ITsString tssWf,
			IHelpTopicProvider helpProvider, string helpFileKey, IVwStylesheet styleSheet)
		{
			CheckDisposed();

			bool otherButtonClicked = false;
			using (SummaryDialogForm form =
				new SummaryDialogForm(this, tssWf, helpProvider, helpFileKey, styleSheet))
			{
				form.ShowDialog(owner);
				if (form.ShouldLink)
					form.LinkToLexicon();
				otherButtonClicked = form.OtherButtonClicked;
			}
			if (otherButtonClicked)
			{
				var entry = ShowFindEntryDialog(this.Object.Cache, this.Mediator, tssWf, owner);
				if (entry != null)
				{
					using (var leuiNew = new LexEntryUi(entry))
					{
						leuiNew.ShowSummaryDialog(owner, entry.HeadWord, helpProvider, helpFileKey, styleSheet);
					}
				}
				else
				{
					// redisplay the original entry (recursively)
					ShowSummaryDialog(owner, tssWf, helpProvider, helpFileKey, styleSheet);
				}
			}
		}
Ejemplo n.º 2
0
		private static void DisplayEntriesRecursive(FdoCache cache, IWin32Window owner,
			Mediator mediator, IVwStylesheet stylesheet,
			IHelpTopicProvider helpProvider, string helpFileKey,
			List<ILexEntry> entries, ITsString tssWf)
		{
			// Loop showing the SummaryDialogForm as long as the user clicks the Other button
			// in that dialog.
			bool otherButtonClicked = false;
			do
			{
				using (var sdform = new SummaryDialogForm(new List<int>(entries.Select(le => le.Hvo)), tssWf,
														helpProvider, helpFileKey,
														stylesheet, cache, mediator))
				{
					SetCurrentModalForm(sdform);
					if (owner == null)
						sdform.StartPosition = FormStartPosition.CenterScreen;
					sdform.ShowDialog(owner);
					if (sdform.ShouldLink)
						sdform.LinkToLexicon();
					otherButtonClicked = sdform.OtherButtonClicked;
				}
				if (otherButtonClicked)
				{
					// Look for another entry to display.  (If the user doesn't select another
					// entry, loop back and redisplay the current entry.)
					var entry = ShowFindEntryDialog(cache, mediator, tssWf, owner);
					if (entry != null)
					{
						// We need a list that contains the entry we found to display on the
						// next go around of this loop.
						entries = new List<ILexEntry>();
						entries.Add(entry);
						tssWf = entry.HeadWord;
					}
				}
			} while (otherButtonClicked);
		}