public CHAR_INFO_ref this[int index] {
     get {
         if (index < 0 || index >= canvas.size.Height) {
             throw new IndexOutOfRangeException("index exceeds specified buffer height.");
         }
         if (references.ContainsKey(index)) {
             return references[index];
         }
         CHAR_INFO_ref res = new CHAR_INFO_ref(x, index, canvas);
         references[index] = res;
         return res;
     }
 }
 public CHAR_INFO_ref this[int index] {
     get {
         if (index < 0 || index >= canvas.size.Height)
         {
             throw new IndexOutOfRangeException("index exceeds specified buffer height.");
         }
         if (references.ContainsKey(index))
         {
             return(references[index]);
         }
         CHAR_INFO_ref res = new CHAR_INFO_ref(x, index, canvas);
         references[index] = res;
         return(res);
     }
 }
 public void Assign(CHAR_INFO_ref charInfoRef) {
     canvas.buffer[y, x] = charInfoRef.canvas.buffer[charInfoRef.y, charInfoRef.x];
 }
 public void Assign(CHAR_INFO_ref charInfoRef)
 {
     canvas.buffer[y, x] = charInfoRef.canvas.buffer[charInfoRef.y, charInfoRef.x];
 }