示例#1
0
        public IEnumerator <SubmitterClass> SearchSubmitter(String submitterString = null, IProgressReporterInterface progressReporter = null)
        {
            IEnumerator <SubmitterClass> enumerator = submitterList.Values.GetEnumerator();
            ProgressReporterClass        progress   = new ProgressReporterClass(submitterList.Count);
            int i = 0;

            while (enumerator.MoveNext())
            {
                if (progressReporter != null)
                {
                    if (progress.Update(i++))
                    {
                        progressReporter.ReportProgress(progress.GetPercent());
                    }
                }
                if (submitterString != null)
                {
                    String submitterStr = enumerator.Current.GetName();

                    if (submitterStr != null)
                    {
                        if (submitterStr.Contains(submitterString))
                        {
                            yield return(enumerator.Current);
                        }
                    }
                }
                else
                {
                    yield return(enumerator.Current);
                }
            }

            trace.TraceInformation("SearchSubmitter(" + submitterString + "): null");
        }
示例#2
0
        public IEnumerator <IndividualClass> SearchPerson(String individualName, IProgressReporterInterface progressReporter = null)
        {
            IEnumerator <IndividualClass> enumerator = individualList.Values.GetEnumerator();
            string searchName = "";
            ProgressReporterClass progress = new ProgressReporterClass(individualList.Count);
            int i = 0;

            if (individualName != null)
            {
                searchName = individualName.ToUpper();
            }

            trace.TraceInformation("SearchPerson()");

            while (enumerator.MoveNext())
            {
                String name = enumerator.Current.GetName().ToUpper();

                if (progressReporter != null)
                {
                    if (progress.Update(i++))
                    {
                        progressReporter.ReportProgress(progress.GetPercent());
                    }
                }

                if (name != null)
                {
                    if (name.Contains(searchName))
                    {
                        yield return(enumerator.Current);
                    }
                }
                else
                {
                    yield return(enumerator.Current);
                }
            }
            trace.TraceInformation("SearchPerson(" + searchName + ") done");
        }
示例#3
0
        public IEnumerator <NoteClass> SearchNote(String noteString = null, IProgressReporterInterface progressReporter = null)
        {
            IEnumerator <NoteClass> enumerator = noteList.Values.GetEnumerator();
            ProgressReporterClass   progress   = new ProgressReporterClass(noteList.Count);
            int i = 0;

            trace.TraceInformation("SearchNote()");

            while (enumerator.MoveNext())
            {
                if (progressReporter != null)
                {
                    if (progress.Update(i++))
                    {
                        progressReporter.ReportProgress(progress.GetPercent());
                    }
                }
                if (noteString != null)
                {
                    String noteStr = enumerator.Current.note;

                    if (noteStr != null)
                    {
                        if (noteStr.Contains(noteString))
                        {
                            yield return(enumerator.Current);
                        }
                    }
                }
                else
                {
                    yield return(enumerator.Current);
                }
            }

            trace.TraceInformation("SearchNote(" + noteString + "): null");
        }
示例#4
0
        public IEnumerator <FamilyClass> SearchFamily(String familyXrefName = null, IProgressReporterInterface progressReporter = null)
        {
            IEnumerator <FamilyClass> enumerator = familyList.Values.GetEnumerator();;
            ProgressReporterClass     progress   = new ProgressReporterClass(familyList.Count);
            int i = 0;

            trace.TraceInformation("SearchFamily()");

            while (enumerator.MoveNext())
            {
                if (progressReporter != null)
                {
                    if (progress.Update(i++))
                    {
                        progressReporter.ReportProgress(progress.GetPercent());
                    }
                }
                if (familyXrefName != null)
                {
                    String name = enumerator.Current.GetXrefName();

                    if (name != null)
                    {
                        if (name.Contains(familyXrefName))
                        {
                            yield return(enumerator.Current);
                        }
                    }
                }
                else
                {
                    yield return(enumerator.Current);
                }
            }

            trace.TraceInformation("SearchFamily(" + familyXrefName + "): null");
        }