Public Class DrawMemento

  Implements Memento
  Private x As Integer, y As Integer
  Private w As Integer, h As Integer
  Private rect As vbPatterns.Rectangle
  Private visDraw As Drawing
  '-----
  Public Sub restore() Implements Memento.restore
    'Odtwórz stan obiektu graficznego
    rect.x = x
    rect.y = y
    rect.h = h
    rect.w = w
    visDraw.rects = rect
  End Sub
  '-----
  Public Sub New(ByRef d As Drawing)
    'Przechowaj stan prostokąta
    visDraw = d
    rect = visDraw.rects
    x = rect.x
    y = rect.y
    w = rect.w
    h = rect.h
  End Sub

End Class
