Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        // 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 ");
            }
        }
Ejemplo n.º 4
0
        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();
            }
        }