Ejemplo n.º 1
0
        public override Command MergeWith(Command command)
        {
            InsertTextContentCommand last = command as InsertTextContentCommand;

            this.index = last.GetIndex();
            this.text  = last.GetText() + this.text;
            return(this);
        }
Ejemplo n.º 2
0
        /* Public members */

        public override bool CanGroupWith(Command command)
        {
            InsertTextContentCommand last = command as InsertTextContentCommand;

            return((this.Path.Compare(last.Path) == 0) &&  //Paths are equal
                   (this.index == (last.GetIndex() + last.GetText().Length)) &&      //This index is the position after the last text
                   (this.text.Length == 1) &&      //A single char was inserted
                   (!(Char.IsWhiteSpace(last.GetLastChar()) && (!Char.IsWhiteSpace(GetLastChar())))));        //A space->non-space sequence is not the case
        }