Ejemplo n.º 1
0
 protected ScrollBar(ScrollBarOrientation orientation)
 {
     this._scrollBarOrientation = orientation;
     this._mouseTimer = new Timer();
     this._mouseTimer.Tick += new EventHandler(this.MouseTimerTick);
     this._mouseTimer.Interval = 100;
     this._mouseTimer.Enabled = false;
     this._clickAction = ScrollBarHitRegion.None;
     this._minimum = 0;
     this._maximum = 100;
     this._largeChange = 10;
     this._smallChange = 1;
     this._value = 0;
     this._arrowButtonsLayout = ScrollBarArrowButtonsLayout.Edges;
     this._leftUpButton = null;
     this._leftUpButtonHighlight = null;
     this._leftUpButtonDisabled = null;
     this._leftUpButtonSize = 0x13;
     this._rightDownButton = null;
     this._rightDownButtonHighlight = null;
     this._rightDownButtonDisabled = null;
     this._rightDownButtonSize = 0x13;
     this._lowTrack = null;
     this._lowTrackHighlight = null;
     this._lowTrackDisabled = null;
     this._highTrack = null;
     this._highTrackHighlight = null;
     this._highTrackDisabled = null;
     this._trackClickBehavior = ScrollBarTrackClickBehavior.Scroll;
     this._thumb = null;
     this._thumbHighlight = null;
     this._thumbDisabled = null;
     this._minimumThumbSize = 11;
     this._maximumThumbSize = 0;
     this._thumbMargins = new MarginPadding();
     this._extension = null;
     this._extensionSize = 13;
     this._extensionLocation = ScrollBarExtensionLocation.LeftTop;
     this._extensionVisible = true;
     this._backgroundBufferBitmap = null;
     this._backgroundBufferGraphics = null;
     this._backgroundValid = BackgroundValid.Invalid;
     this._backBufferBitmap = null;
     this._backBufferGraphics = null;
     this.DrawTrack = null;
     this.DrawArrowButton = null;
     this.DrawThumb = null;
     this.ValueChanged = null;
     this.MinimumReached = null;
     this.MaximumReached = null;
 }
Ejemplo n.º 2
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (this._leftUpButton != null)
         {
             this._leftUpButton.PropertyChanged -= new EventHandler(this.LeftUpButton_PropertyChanged);
         }
         if (this._leftUpButtonHighlight != null)
         {
             this._leftUpButtonHighlight.PropertyChanged -= new EventHandler(this.LeftUpButton_PropertyChanged);
         }
         if (this._leftUpButtonDisabled != null)
         {
             this._leftUpButtonDisabled.PropertyChanged -= new EventHandler(this.LeftUpButton_PropertyChanged);
         }
         if (this._rightDownButton != null)
         {
             this._rightDownButton.PropertyChanged -= new EventHandler(this.RightDownButton_PropertyChanged);
         }
         if (this._rightDownButtonHighlight != null)
         {
             this._rightDownButtonHighlight.PropertyChanged -= new EventHandler(this.RightDownButton_PropertyChanged);
         }
         if (this._rightDownButtonDisabled != null)
         {
             this._rightDownButtonDisabled.PropertyChanged -= new EventHandler(this.RightDownButton_PropertyChanged);
         }
         if (this._lowTrack != null)
         {
             this._lowTrack.PropertyChanged -= new EventHandler(this.LowTrack_PropertyChanged);
         }
         if (this._lowTrackHighlight != null)
         {
             this._lowTrackHighlight.PropertyChanged -= new EventHandler(this.LowTrack_PropertyChanged);
         }
         if (this._lowTrackDisabled != null)
         {
             this._lowTrackDisabled.PropertyChanged -= new EventHandler(this.LowTrack_PropertyChanged);
         }
         if (this._highTrack != null)
         {
             this._highTrack.PropertyChanged -= new EventHandler(this.HighTrack_PropertyChanged);
         }
         if (this._highTrackHighlight != null)
         {
             this._highTrackHighlight.PropertyChanged -= new EventHandler(this.HighTrack_PropertyChanged);
         }
         if (this._highTrackDisabled != null)
         {
             this._highTrackDisabled.PropertyChanged -= new EventHandler(this.HighTrack_PropertyChanged);
         }
         if (this._thumb != null)
         {
             this._thumb.PropertyChanged -= new EventHandler(this.Thumb_PropertyChanged);
         }
         if (this._thumbHighlight != null)
         {
             this._thumbHighlight.PropertyChanged -= new EventHandler(this.Thumb_PropertyChanged);
         }
         if (this._thumbDisabled != null)
         {
             this._thumbDisabled.PropertyChanged -= new EventHandler(this.Thumb_PropertyChanged);
         }
         if (this._extension != null)
         {
             this._extension.PropertyChanged -= new ScrollBarExtensionBase.PropertyChangedHandler(this.Extension_PropertyChanged);
             this.ValueChanged = (EventHandler) Delegate.Remove(this.ValueChanged, new EventHandler(this._extension.ScrollBar_ValueChanged));
             this._extension.Parent = null;
         }
         if (this._mouseTimer != null)
         {
             this._mouseTimer.Enabled = false;
             this._mouseTimer.Dispose();
         }
         if (_cachedPen != null)
         {
             _cachedPen.Dispose();
         }
         if (_cachedSolidBrush != null)
         {
             _cachedSolidBrush.Dispose();
         }
         if (_fakePixel != null)
         {
             _fakePixel.Dispose();
         }
         if (_helperRegion != null)
         {
             _helperRegion.Dispose();
         }
         if (this._backgroundBufferGraphics != null)
         {
             this._backgroundBufferGraphics.Dispose();
         }
         if (this._backgroundBufferBitmap != null)
         {
             this._backgroundBufferBitmap.Dispose();
         }
         if (this._backBufferGraphics != null)
         {
             this._backBufferGraphics.Dispose();
         }
         if (this._backBufferBitmap != null)
         {
             this._backBufferBitmap.Dispose();
         }
     }
     this._leftUpButton = null;
     this._leftUpButtonHighlight = null;
     this._leftUpButtonDisabled = null;
     this._rightDownButton = null;
     this._rightDownButtonHighlight = null;
     this._rightDownButtonDisabled = null;
     this._lowTrack = null;
     this._lowTrackHighlight = null;
     this._lowTrackDisabled = null;
     this._highTrack = null;
     this._highTrackHighlight = null;
     this._highTrackDisabled = null;
     this._thumb = null;
     this._thumbHighlight = null;
     this._thumbDisabled = null;
     this._mouseTimer = null;
     _cachedPen = null;
     _cachedSolidBrush = null;
     _fakePixel = null;
     _helperRegion = null;
     this._backgroundBufferBitmap = null;
     this._backgroundBufferGraphics = null;
     this._backBufferGraphics = null;
     this._backBufferBitmap = null;
     base.Dispose(disposing);
 }