public void Begin(string displayName, int minProgress, int maxProgress, int currentProgress) { Action begin = delegate { this.frm = new MyProgressIndicationForm(); SubscribeFormEvents(); this.frm.Begin(minProgress, maxProgress, currentProgress); this.frm.ShowDialog(this.snapControl); }; this.snapControl.BeginInvoke(begin); }
public void End() { if (object.ReferenceEquals(this.frm, null)) { return; } Action end = delegate { UnsubscribeFormEvents(); this.frm.Dispose(); this.frm = null; }; this.snapControl.BeginInvoke(end); }
protected virtual void Dispose(bool disposing) { if (disposing) { if (!object.ReferenceEquals(this.frm, null)) { this.frm.Dispose(); this.frm = null; } if (!object.ReferenceEquals(this.cts, null)) { this.cts.Dispose(); this.cts = null; } } }