/// <inheritdoc/> public override void Insert(InsertionContext context) { if (text != null) { context.InsertText(text); } }
/// <inheritdoc/> public override void Insert(InsertionContext context) { context.InsertText(context.SelectedText); if (string.IsNullOrEmpty(context.SelectedText)) { SnippetCaretElement.SetCaret(context); } }
/// <inheritdoc/> public override void Insert(InsertionContext context) { if (targetElement != null) { int start = context.InsertionPosition; string inputText = targetElement.Text; if (inputText != null) { context.InsertText(ConvertText(inputText)); } int end = context.InsertionPosition; AnchorSegment segment = new AnchorSegment(context.Document, start, end - start); context.RegisterActiveElement(this, new BoundActiveElement(context, targetElement, this, segment)); } }
/// <inheritdoc/> public override void Insert(InsertionContext context) { if (targetElement != null) { TextAnchor start = context.Document.CreateAnchor(context.InsertionPosition); start.MovementType = AnchorMovementType.BeforeInsertion; start.SurviveDeletion = true; string inputText = targetElement.Text; if (inputText != null) { context.InsertText(ConvertText(inputText)); } TextAnchor end = context.Document.CreateAnchor(context.InsertionPosition); end.MovementType = AnchorMovementType.BeforeInsertion; end.SurviveDeletion = true; AnchorSegment segment = new AnchorSegment(start, end); context.RegisterActiveElement(this, new BoundActiveElement(context, targetElement, this, segment)); } }
/// <inheritdoc/> public override void Insert(InsertionContext context) { context.InsertText(context.SelectedText); if (string.IsNullOrEmpty(context.SelectedText)) SnippetCaretElement.SetCaret(context); }
/// <inheritdoc/> public override void Insert(InsertionContext context) { if (text != null) context.InsertText(text); }