protected override void OnHandleDestroyed( EventArgs e ) { base.OnHandleDestroyed( e ); _renderer.Setdown(); if( _timer != null ) { _timer.Enabled = false; _timer.Tick -= new EventHandler( _timer_Tick ); _timer.Dispose(); _timer = null; } if( _updateTimer != null ) { _updateTimer.Tick -= new System.EventHandler( this._updateTimer_Tick ); _updateTimer.Dispose(); _updateTimer = null; } if( _animationRequests != null ) { _animationRequests.Invalidate -= new EventHandler( _animationRequests_Invalidate ); _animationRequests.InvalidateTreeNode -= new TreeNodeRectangleEventHandler( _animationRequests_InvalidateTreeNode ); _animationRequests.Update -= new EventHandler( _animationRequests_Update ); _animationRequests.Dispose(); _animationRequests = null; } }
protected override void OnHandleCreated( EventArgs e ) { base.OnHandleCreated( e ); _renderer.Setup(); _timer = new Timer(); _timer.Interval = 200; _timer.Enabled = true; _timer.Tick += new EventHandler( _timer_Tick ); if( _updateTimer != null ) { _updateTimer.Enabled = true; _updateTimer.Tick += new System.EventHandler( this._updateTimer_Tick ); } _animationRequests = new Internal.AnimationRequests( this ); _animationRequests.Invalidate += new EventHandler( _animationRequests_Invalidate ); _animationRequests.InvalidateTreeNode += new TreeNodeRectangleEventHandler( _animationRequests_InvalidateTreeNode ); _animationRequests.Update += new EventHandler( _animationRequests_Update ); }