ICSharpCode.AvalonEdit.Snippets.SnippetBoundElement.ConvertText C# (CSharp) Method

ConvertText() public method

Converts the text before copying it.
public ConvertText ( string input ) : string
input string
return string
		public virtual string ConvertText(string input)
		{
			return input;
		}
		

Usage Example

示例#1
0
 void targetElement_TextChanged(object sender, EventArgs e)
 {
     // Don't copy text if the segments overlap (we would get an endless loop).
     // This can happen if the user deletes the text between the replaceable element and the bound element.
     if (segment.GetOverlap(targetElement.Segment) == SimpleSegment.Invalid)
     {
         int    offset = segment.Offset;
         int    length = segment.Length;
         string text   = boundElement.ConvertText(targetElement.Text);
         context.Document.Replace(offset, length, text);
         if (length == 0)
         {
             // replacing an empty anchor segment with text won't enlarge it, so we have to recreate it
             segment = new AnchorSegment(context.Document, offset, text.Length);
         }
     }
 }
All Usage Examples Of ICSharpCode.AvalonEdit.Snippets.SnippetBoundElement::ConvertText