public void Push(MirrorOperation operation)
		{
			if (operation == null)
				throw new ArgumentNullException("operation");

			var control = new MirrorOperationControl(operation)
			{
				Dock = DockStyle.Top
			};
			panel.Controls.Add(control);
			control.BringToFront();

			control.Aborted += (s, e) => { RemoveControl(control); };
			operation.Finished += (s, e) =>
			{
				RemoveControl(control);

				if (!OperationControls.Any())
				{
					if (AllFinished != null)
						AllFinished(this, EventArgs.Empty);
				}
				else
					TriggerNextOperation();
			};

			TriggerNextOperation();
		}
		private void RemoveControl(MirrorOperationControl control)
		{
			if (panel.Controls.Contains(control))
				panel.Controls.Remove(control);
		}
Exemple #3
0
 public Status(MirrorOperationControl control)
 {
     _control = control;
 }