/// <inheritdoc/> public override void Insert(InsertionContext context) { int start = context.InsertionPosition; base.Insert(context); int end = context.InsertionPosition; context.RegisterActiveElement(this, new ReplaceableActiveElement(context, start, end)); }
/// <inheritdoc /> public override void Insert(InsertionContext context) { TextAnchor start = context.Document.CreateAnchor(context.InsertionPosition); start.MovementType = AnchorMovementType.BeforeInsertion; start.SurviveDeletion = true; AnchorSegment segment = new AnchorSegment(start, start); context.RegisterActiveElement(this, new AnchorElement(segment, Name, context)); }
/// <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)); } }