Пример #1
0
        /// <summary>
        /// Returns an AnalysisOccurrence at least close to the given bookmark.
        /// If we can't, we return null. This version reports whether we found an exact match or not.
        /// </summary>
        /// <param name="bookmark"></param>
        /// <param name="fExactMatch"></param>
        /// <returns></returns>
        internal AnalysisOccurrence ConvertBookmarkToAnalysis(IStTextBookmark bookmark, out bool fExactMatch)
        {
            fExactMatch = false;
            if (RootStText == null || RootStText.ParagraphsOS.Count == 0 ||
                bookmark.IndexOfParagraph < 0 || bookmark.BeginCharOffset < 0 || bookmark.IndexOfParagraph >= RootStText.ParagraphsOS.Count)
            {
                return(null);
            }
            var para = RootStText.ParagraphsOS[bookmark.IndexOfParagraph] as IStTxtPara;

            if (para == null)
            {
                return(null);
            }

            var point = SegmentServices.FindNearestAnalysis(para,
                                                            bookmark.BeginCharOffset, bookmark.EndCharOffset, out fExactMatch);

            if (point != null && point.Analysis is IPunctuationForm)
            {
                // Don't want to return punctuation! Wordform or null!
                fExactMatch = false;
                if (point.Index > 0)
                {
                    return(point.PreviousWordform());
                }
                return(point.NextWordform());
            }
            return(point);
        }
Пример #2
0
 public void SelectBookmark(IStTextBookmark bookmark)
 {
     CheckDisposed();
     MakeTextSelectionAndScrollToView(bookmark.BeginCharOffset, bookmark.EndCharOffset, 0, bookmark.IndexOfParagraph);
 }
Пример #3
0
		public void SelectBookmark(IStTextBookmark bookmark)
		{
			CheckDisposed();
			MakeTextSelectionAndScrollToView(bookmark.BeginCharOffset, bookmark.EndCharOffset, 0, bookmark.IndexOfParagraph);
		}
Пример #4
0
		/// <summary>
		/// Returns an AnalysisOccurrence at least close to the given bookmark.
		/// If we can't, we return null. This version reports whether we found an exact match or not.
		/// </summary>
		/// <param name="bookmark"></param>
		/// <param name="fExactMatch"></param>
		/// <returns></returns>
		internal AnalysisOccurrence ConvertBookmarkToAnalysis(IStTextBookmark bookmark, out bool fExactMatch)
		{
			fExactMatch = false;
			if (RootStText == null || RootStText.ParagraphsOS.Count == 0
				|| bookmark.IndexOfParagraph < 0 || bookmark.BeginCharOffset < 0 || bookmark.IndexOfParagraph >= RootStText.ParagraphsOS.Count)
				return null;
			var para = RootStText.ParagraphsOS[bookmark.IndexOfParagraph] as IStTxtPara;
			if (para == null)
				return null;

			var point = SegmentServices.FindNearestAnalysis(para,
				bookmark.BeginCharOffset, bookmark.EndCharOffset, out fExactMatch);
			if (point != null && point.Analysis is IPunctuationForm)
			{
				// Don't want to return punctuation! Wordform or null!
				fExactMatch = false;
				if (point.Index > 0)
					return point.PreviousWordform();
				return point.NextWordform();
			}
			return point;
		}
Пример #5
0
		/// <summary>
		/// Returns an AnalysisOccurrence at least close to the given bookmark.
		/// If we can't, we return null.
		/// </summary>
		/// <param name="bookmark"></param>
		/// <returns></returns>
		internal AnalysisOccurrence ConvertBookmarkToAnalysis(IStTextBookmark bookmark)
		{
			bool fDummy;
			return ConvertBookmarkToAnalysis(bookmark, out fDummy);
		}
Пример #6
0
		public void SelectBookmark(IStTextBookmark bookmark)
		{
			SelectOccurrence(ConvertBookmarkToAnalysis(bookmark));
		}
Пример #7
0
		/// <summary>
		/// This public version enables call by reflection from InterlinMaster of the internal CCBody
		/// method that selects (and scrolls to) the bookmarked location in the constituent chart.
		/// </summary>
		/// <param name="bookmark"></param>
		public void SelectBookmark(IStTextBookmark bookmark)
		{
			m_body.SelectAndScrollToBookmark(bookmark as InterAreaBookmark);
		}
Пример #8
0
        /// <summary>
        /// Returns an AnalysisOccurrence at least close to the given bookmark.
        /// If we can't, we return null.
        /// </summary>
        /// <param name="bookmark"></param>
        /// <returns></returns>
        internal AnalysisOccurrence ConvertBookmarkToAnalysis(IStTextBookmark bookmark)
        {
            bool fDummy;

            return(ConvertBookmarkToAnalysis(bookmark, out fDummy));
        }
Пример #9
0
 public void SelectBookmark(IStTextBookmark bookmark)
 {
     SelectOccurrence(ConvertBookmarkToAnalysis(bookmark));
 }