示例#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();
            }
        }
示例#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);
            }
        }
示例#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;
            //   }
            //}
        }
示例#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);
    }
 }
示例#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();
         }
      }