PSAttack.PSAttackProcessing.AttackState.endOfDisplayCmdPos C# (CSharp) Method

endOfDisplayCmdPos() public method

public endOfDisplayCmdPos ( ) : int
return int
        public int endOfDisplayCmdPos()
        {
            return this.promptLength + this.displayCmd.Length;
        }

Usage Example

Beispiel #1
0
 // called when up or down is entered
 static AttackState history(AttackState attackState)
 {
     if (attackState.history.Count > 0)
     {
         if (attackState.loopType == null)
         {
             attackState.loopType = "history";
             if (attackState.loopPos == 0)
             {
                 attackState.loopPos = attackState.history.Count;
             }
         }
         if (attackState.keyInfo.Key == ConsoleKey.UpArrow && attackState.loopPos > 0)
         {
             attackState.loopPos   -= 1;
             attackState.displayCmd = attackState.history[attackState.loopPos];
         }
         if (attackState.keyInfo.Key == ConsoleKey.DownArrow)
         {
             if ((attackState.loopPos + 1) > (attackState.history.Count - 1))
             {
                 attackState.displayCmd = "";
             }
             else
             {
                 attackState.loopPos   += 1;
                 attackState.displayCmd = attackState.history[attackState.loopPos];
             }
         }
         attackState.cursorPos = attackState.endOfDisplayCmdPos();
     }
     return(attackState);
 }
All Usage Examples Of PSAttack.PSAttackProcessing.AttackState::endOfDisplayCmdPos