Example #1
0
        /// <summary>
        /// Changes the currently active band to a given band
        /// </summary>
        /// <param name="band">The band to activate</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;
                OnActiveBandChanged(new EventArgs());
                PerformLayout();
                Invalidate();
            }
        }
Example #2
0
        /// <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);
            }
        }