private void initializeBuffer()
  {
    if (this.BufferGraphics != null) {
      this.BufferGraphics.dispose();
    }
    if (this.BufferImage != null)
      this.BufferImage.flush();
    Object localObject;
    if (this.ImageContainerParent == null)
    {
      localObject = this;
    }
    else
    {
      ImageContainer localImageContainer = this.ImageContainerParent;
      while (localImageContainer.getImageContainerParent() != null) {
        localImageContainer = localImageContainer.getImageContainerParent();
      }
      localObject = localImageContainer;

      if (!localImageContainer.Added)
      {
        return;
      }
    }

    if (this.BufferSize == null)
      this.BufferImage = ((Component)localObject).createImage(getSize().width, getSize().height);
    else {
      this.BufferImage = ((Component)localObject).createImage(this.BufferSize.width, this.BufferSize.height);
    }
    this.BufferGraphics = this.BufferImage.getGraphics();

    for (int i = 0; i < this.ImageContainerChildren.size(); i++) {
      ((ImageContainer)this.ImageContainerChildren.elementAt(i)).initializeBuffer();
    }

    taintBuffer();
  }