public void ProgressChanged(object sender, ProgressChangedEventArgs e) { trace.TraceInformation("ReadFileWorker::ProgressChanged(" + e.ProgressPercentage + ")" + DateTime.Now); if (familyTree != null) { progressReporter.ReportProgress(e.ProgressPercentage, familyTree.GetShortTreeInfo()); } else { progressReporter.ReportProgress(e.ProgressPercentage); } }
public void FileLoadProgress(int progressPercent, string text = null) { trace.TraceInformation("FamilyForm2::FileLoadProgress(" + progressPercent + ")"); if (progressPercent < 0) { familyTree = readFileWorker.GetFamilyTree(); if (familyTree != null) { if (trace.Switch.Level.HasFlag(SourceLevels.Information)) { familyTree.Print(); } toolStripProgressBar1.Visible = false; toolStripStatusLabel1.Text = familyTree.GetShortTreeInfo();//"I:" + familyTree.individualList.Count + " F:" + familyTree.familyList.Count + " N:" + familyTree.noteList.Count; //PopulatePersonList(); ConnectPanelsToTree(familyTree); } else { trace.TraceEvent(TraceEventType.Error, 0, " Error: tree == null! " + DateTime.Now); } progressReporter = null; readFileWorker = null; } else { TextCallback(progressPercent, text); } }
// This is the method to run when the timer is raised. private void TimerEventProcessor(Object myObject, EventArgs myEventArgs) { //updateTimer.Stop(); //updateTimer.Enabled = true; if (!this.statusStrip1.InvokeRequired) { if (familyTree != null) { trace.TraceData(TraceEventType.Warning, 0, "Update timer expired:" + familyTree.GetShortTreeInfo() + toolStripStatusLabel1.Text + toolStripStatusLabel1.Visible); if (!toolStripStatusLabel1.Visible) { toolStripStatusLabel1.Text = familyTree.GetShortTreeInfo(); } } } else { trace.TraceData(TraceEventType.Warning, 0, "invoke req "); } }
public void Completed(object sender, RunWorkerCompletedEventArgs e) { trace.TraceInformation("WriteFileWorker::Completed()" + DateTime.Now); trace.TraceInformation(" Start time:" + startTime + " end time: " + DateTime.Now); if (familyTree != null) { progressReporter.Completed(familyTree.GetShortTreeInfo()); } else { progressReporter.Completed(); } }