/// <summary> /// Changes the currently active band to a new band /// </summary> /// <param name="newBand">The new band.</param> public void SetActiveBand(NaviBand newBand) { NaviBandEventArgs e = new NaviBandEventArgs(newBand); OnActiveBandChanging(e); if (!e.Canceled) { if (activeBand != newBand) { foreach (NaviBand band in bands) { if ((band != newBand) && (band.Button != null)) { band.Button.Active = false; } } } if ((newBand != null) && (newBand.Button != null)) { newBand.Button.Active = true; } activeBand = newBand; OnLayout(new LayoutEventArgs(this, "ActiveBand")); OnActiveBandChanged(new EventArgs()); Invalidate(); } else { // Lost focus but did not recieve an mouse leave event. So force redraw newBand.Button.Active = false; } }
/// <summary> /// Raises the ActiveBandChanging event /// </summary> /// <param name="e">Additional event info</param> internal void OnActiveBandChanging(NaviBandEventArgs e) { NaviBandEventHandler handler = activeBandChanging; if (handler != null) { handler(this, e); } }