VisualLineElement that represents a piece of text and is a clickable link.
상속: ICSharpCode.AvalonEdit.Rendering.VisualLineText
 protected override VisualLineElement ConstructElementFromMatch(Match m)
 {
     Uri uri = GetUriFromMatch(m);
     if (uri == null)
         return null;
     VisualLineLinkText linkText = new VisualLineLinkText(CurrentContext.VisualLine, m.Length);    
     linkText.NavigateUri = uri;
     linkText.RequireControlModifierForClick = this.RequireControlModifierForClick;
    
     return linkText;
 }
예제 #2
0
        /// <summary>
        /// Constructs a VisualLineElement that replaces the matched text.
        /// The default implementation will create a <see cref="VisualLineLinkText"/>
        /// based on the URI provided by <see cref="GetUriFromMatch"/>.
        /// </summary>
        protected virtual VisualLineElement ConstructElementFromMatch(Match m)
        {
            Uri uri = GetUriFromMatch(m);

            if (uri == null)
            {
                return(null);
            }
            VisualLineLinkText linkText = new VisualLineLinkText(CurrentContext.VisualLine, m.Length);

            linkText.NavigateUri = uri;
            linkText.RequireControlModifierForClick = this.RequireControlModifierForClick;
            return(linkText);
        }
예제 #3
0
		/// <inheritdoc/>
		public override VisualLineElement ConstructElement(int offset)
		{
			int matchOffset;
			Match m = GetMatch(offset, out matchOffset);
			if (m.Success && matchOffset == offset) {
				Uri uri = GetUriFromMatch(m);
				if (uri == null)
					return null;
				VisualLineLinkText linkText = new VisualLineLinkText(CurrentContext.VisualLine, m.Length);
				linkText.NavigateUri = uri;
				linkText.RequireControlModifierForClick = this.RequireControlModifierForClick;
				return linkText;
			} else {
				return null;
			}
		}
예제 #4
0
        /// <inheritdoc/>
        public override VisualLineElement ConstructElement(int offset)
        {
            Match m = GetMatch(offset);

            if (m.Success && m.Index == 0)
            {
                VisualLineLinkText linkText = new VisualLineLinkText(CurrentContext.VisualLine, m.Length);
                linkText.NavigateUri = GetUriFromMatch(m);
                linkText.RequireControlModifierForClick = this.RequireControlModifierForClick;
                return(linkText);
            }
            else
            {
                return(null);
            }
        }
예제 #5
0
        /// <inheritdoc/>
        public override VisualLineElement ConstructElement(int offset)
        {
            int   matchOffset;
            Match m = GetMatch(offset, out matchOffset);

            if (m.Success && matchOffset == offset)
            {
                Uri uri = GetUriFromMatch(m);
                if (uri == null)
                {
                    return(null);
                }
                VisualLineLinkText linkText = new VisualLineLinkText(CurrentContext.VisualLine, m.Length);
                linkText.NavigateUri = uri;
                linkText.RequireControlModifierForClick = this.RequireControlModifierForClick;
                return(linkText);
            }
            else
            {
                return(null);
            }
        }
예제 #6
0
 /// <inheritdoc/>
 public override VisualLineElement ConstructElement(int offset)
 {
     Match m = GetMatch(offset);
     if (m.Success && m.Index == 0) {
         try
         {
             VisualLineLinkText linkText = new VisualLineLinkText(CurrentContext.VisualLine, m.Length);
             linkText.NavigateUri = GetUriFromMatch(m);
             linkText.RequireControlModifierForClick = this.RequireControlModifierForClick;
             return linkText;
         }
         catch
         {
             return null;
         }
     } else {
         return null;
     }
 }