Example #1
0
 public override void write(String message, Paper sheet)
 {
     int len = message.Length;
     if ( graphiteAmount < len ) {
         sheet.writeOn(message.Substring(0, graphiteAmount));
         graphiteAmount = 0;
     } else {
         sheet.writeOn(message);
         graphiteAmount -= len;
     }
 }
Example #2
0
 public override void write(String message, Paper sheet)
 {
     int len = message.Length;
     if ( inkQuantity < len ) {
         sheet.writeOn(message.Substring(0, inkQuantity));
         inkQuantity = 0;
     } else {
         sheet.writeOn(message);
         inkQuantity -= len;
     }
 }
Example #3
0
 public override void write(String message, Paper sheet)
 {
     if (!isOpen) {
         throw new ClosedPenException();
     }
     int len = message.Length;
     if ( inkQuantity < len ) {
         sheet.writeOn(message.Substring(0, inkQuantity));
         inkQuantity = 0;
     } else {
         sheet.writeOn(message);
         inkQuantity -= len;
     }
 }