Example #1
0
		public void ProgressState_changesAndResetsCursor()
		{
			Assert.That(Application.UseWaitCursor == false, "Not using wait cursor");
			Cursor.Current = Cursors.Default;
			using (var statusBar = new StatusBar())
			{
				using (var panel = new StatusBarProgressPanel(statusBar))
				{
					using (new ProgressState(panel))
					{
						Assert.That(Application.UseWaitCursor, "Changed to using wait cursor");
					}
					Assert.That(Application.UseWaitCursor == false, "Back to not using wait cursor");
				}
			}
		}
Example #2
0
		public Form1()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

//			this.statusBar1.Panels.Add(this.statusBarProgressPanel1);
			statusBarProgressPanel2 = new StatusBarProgressPanel(this.statusBar1);
			//((System.ComponentModel.ISupportInitialize)(this.statusBarProgressPanel2)).BeginInit();
			this.statusBar1.Panels.Add(this.statusBarProgressPanel2);
			statusBarProgressPanel2.Width=200;

		//	statusBarProgressPanel2.Parent.Refresh();
			//((System.ComponentModel.ISupportInitialize)(this.statusBarProgressPanel2)).EndInit();
			this.statusBar1.Refresh();
		}
		/// <summary>
		/// This progress state tries to remember how long each milestone took last time, and
		/// thereby give a more smooth and accurate progress progression the next time, to the extent that
		/// the same amount of work is being done. The times taken last time are stored based on
		/// the task label parameter.
		/// </summary>
		/// <param name="progressBar"></param>
		/// <param name="applicationKey"></param>
		/// <param name="taskLabel"></param>
		public PredictiveProgressState(StatusBarProgressPanel progressBar, RegistryKey applicationKey, string taskLabel)
			: base(progressBar)
		{
			m_taskLabel = taskLabel;
		}
			public ProgressReporter(StatusBarProgressPanel panel)
				: base(panel)
			{
			}
		/// <summary>
		/// This progress state tries to remember how long each milestone took last time, and
		/// thereby give a more smooth and accurate progress progression the next time, to the extent that
		/// the same amount of work is being done. The times taken last time are stored based on
		/// the task label parameter.
		/// </summary>
		/// <param name="progressBar"></param>
		/// <param name="taskLabel"></param>
		public PredictiveProgressState(StatusBarProgressPanel progressBar, string taskLabel)
			: base(progressBar)
		{
			m_taskLabel = taskLabel;
		}