/// <inheritdoc/>
        public override void Insert(InsertionContext context)
        {
            var start = context.InsertionPosition;

            base.Insert(context);
            var end = context.InsertionPosition;

            context.RegisterActiveElement(this, new ReplaceableActiveElement(context, start, end));
        }
        /// <inheritdoc />
        public override void Insert(InsertionContext context)
        {
            var start = context.Document.CreateAnchor(context.InsertionPosition);

            start.MovementType    = AnchorMovementType.BeforeInsertion;
            start.SurviveDeletion = true;
            var segment = new AnchorSegment(start, start);

            context.RegisterActiveElement(this, new AnchorElement(segment, Name, context));
        }
Exemplo n.º 3
0
 /// <inheritdoc/>
 public override void Insert(InsertionContext context)
 {
     if (TargetElement != null)
     {
         var start = context.Document.CreateAnchor(context.InsertionPosition);
         start.MovementType    = AnchorMovementType.BeforeInsertion;
         start.SurviveDeletion = true;
         var inputText = TargetElement.Text;
         if (inputText != null)
         {
             context.InsertText(ConvertText(inputText));
         }
         var end = context.Document.CreateAnchor(context.InsertionPosition);
         end.MovementType    = AnchorMovementType.BeforeInsertion;
         end.SurviveDeletion = true;
         var segment = new AnchorSegment(start, end);
         context.RegisterActiveElement(this, new BoundActiveElement(context, TargetElement, this, segment));
     }
 }