Example #1
0
		private void UpdateProgressBarValue(NuGenProgressBar progressBar)
		{
			Debug.Assert(progressBar != null, "progressBar != null");

			if (progressBar.Value == progressBar.Maximum)
			{
				progressBar.Value = progressBar.Minimum;
			}

			progressBar.Value++;
		}
        /*
         * OnUnsubscribeControlEvents
         */

        /// <summary>
        /// Unsubscribes events from the hosted control.
        /// </summary>
        /// <param name="control">The control from which to unsubscribe events.</param>
        protected override void OnUnsubscribeControlEvents(Control control)
        {
            base.OnUnsubscribeControlEvents(control);

            NuGenProgressBar progressBar = (NuGenProgressBar)control;

            progressBar.MarqueeAnimationSpeedChanged -= progressBar_MarqueeAnimationSpeedChanged;
            progressBar.MaximumChanged -= progressBar_MaximumChanged;
            progressBar.MinimumChanged -= progressBar_MinimumChanged;
            progressBar.StepChanged    -= progressBar_StepChanged;
            progressBar.StyleChanged   -= progressBar_StyleChanged;
            progressBar.ValueChanged   -= progressBar_ValueChanged;
        }
        /*
         * CreateControlInstance
         */

        private static Control CreateControlInstance(INuGenServiceProvider serviceProvider)
        {
            if (serviceProvider == null)
            {
                throw new ArgumentNullException("serviceProvider");
            }

            NuGenProgressBar progressBar = new NuGenProgressBar(serviceProvider);

            progressBar.Size        = new Size(100, 20);
            progressBar.MinimumSize = new Size(10, 5);

            return(progressBar);
        }
		public void SetUp()
		{
			_progressBar = new NuGenProgressBar(new ProgressBarServiceProvider());
		}
		private static Control CreateControlInstance(INuGenServiceProvider serviceProvider)
		{
			if (serviceProvider == null)
			{
				throw new ArgumentNullException("serviceProvider");
			}

			NuGenProgressBar progressBar = new NuGenProgressBar(serviceProvider);
			progressBar.Size = new Size(100, 20);
			progressBar.MinimumSize = new Size(10, 5);

			return progressBar;
		}