private void HeapReconstructorObserver(HeapReconstructor.TEvent aEvent, HeapReconstructor aReconstructor) { if (InvokeRequired) { HeapReconstructor.Observer observer = new HeapReconstructor.Observer(HeapReconstructorObserver); this.BeginInvoke(observer, new object[] { aEvent, aReconstructor }); } else { switch (aEvent) { case HeapReconstructor.TEvent.EReconstructingStarted: iProgressBar.Maximum = 100; //% iProgressBar.Minimum = 0; //% iProgressBar.Value = 0; break; case HeapReconstructor.TEvent.EReconstructingProgress: iProgressBar.Value = iReconstructor.Progress; break; case HeapReconstructor.TEvent.EReconstructingComplete: Close(); break; } } }
private void HeapReconstructorObserver(HeapReconstructor.TEvent aEvent, HeapReconstructor aReconstructor) { if (InvokeRequired) { HeapReconstructor.Observer observer = new HeapReconstructor.Observer(HeapReconstructorObserver); this.BeginInvoke(observer, new object[] { aEvent, aReconstructor }); } else { // Select correct progress bar... string title = "Reading Heap 1..."; if (aReconstructor == iReconstructor2) { title = "Reading Heap 2..."; } // switch (aEvent) { case HeapReconstructor.TEvent.EReconstructingStarted: this.Text = title; iProgBar.Maximum = 100; //% iProgBar.Minimum = 0; //% iProgBar.Value = 0; break; case HeapReconstructor.TEvent.EReconstructingProgress: iProgBar.Value = aReconstructor.Progress; break; case HeapReconstructor.TEvent.EReconstructingComplete: iProgBar.Value = 100; if (aReconstructor == iReconstructor1) { // Finished first heap, now move on to second iReconstructor2.Reconstruct(); } else { // Start output engine iComparisonEngine.Compare(); } break; } } }