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);
            }
        }
Example #3
0
        private void naviBar1_ActiveBandChanging(object sender, Guifreaks.Navisuite.NaviBandEventArgs e)
        {
            if (e.NewActiveBand == naviBand2)
            {
                MessageBox.Show("Test succeeded");
                e.Canceled = true;
            }


            //textBoxBarLog.AppendText("BandChanging" + Environment.NewLine);
            //if (e.NewActiveBand == naviBand2)
            //{
            //   if (MessageBox.Show("Do you want to change to Band 2?", "Confirm",
            //      MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.No)
            //   {
            //      e.Canceled = true;
            //   }
            //}
        }
Example #4
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);
    }
 }
Example #5
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();
         }
      }