Ejemplo n.º 1
0
 /// <summary>
 /// 删除字符
 /// </summary>
 private void DelectChar()
 {
     if (this.PParser.PCursor.CousorPointForWord.X + 1 >= this.PParser.GetLineString.Text.Length)
     {
         if (this.PParser.PCursor.CousorPointForWord.Y >= this.PParser.PLineString.Count - 1)
         {
             this.PIsAddUndo = false;
             return;
         }
         this.pType = EDeleteType.Enter;
         base.Execute();
         this.MergeLineString();
         this.ChangeIncrementLine(-1);
     }
     else
     {
         var lnpID = this.PParser.GetLineString.GetLnpAndId();
         this.pType = EDeleteType.Char;
         base.Execute();
         var deleteChar = this.PParser.GetLineString.Text[this.PParser.PCursor.CousorPointForWord.X + 1];
         var text       = this.GetLineStringEffectualText().Remove(this.PParser.PCursor.CousorPointForWord.X + 1, 1);
         //this.ResetLineString(this.PParser.GetLineString, text);
         this.SetResetLineString(this.PParser.GetLineString, text);
         this.RemovePuckerLeavingOnly(lnpID, this.PParser.GetLineString);
         (this.PActionOperation as InsertAction).PInsertChar = deleteChar;
     }
     this.SetSurosrPoint();
 }
Ejemplo n.º 2
0
        public override void Execute()
        {
            this.PParser.PIEdit.SetChangeText();
            if (this.PParser.GetSelectPartPoint == null)
            {
                DelectChar();
            }
            else
            {
                this.PParser.PIEdit.SetChangeText();
                this.pType = EDeleteType.Select;
                base.Execute();
                //this.SetSelectBg();
                var selectBgs = this.GetSelectBg();
                pDelStr = this.DeleteSelectPart(out this.PDeleteLineCount, false);
                this.SetDrawBgClearSelectAndPucker(selectBgs);

                this.SetSurosrPoint();
                this.End();
                this.ChangeIncrementLine(this.GetDeleteLineCount * -1);
            }
            this.PParser.PIEdit.Invalidate();
        }