示例#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;
     }
 }
示例#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;
     }
 }
示例#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;
     }
 }