コード例 #1
0
        public IEnumerator <SubmitterClass> SearchSubmitter(String submitterString = null, ProgressReporterInterface 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, ProgressReporterInterface 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, ProgressReporterInterface 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, ProgressReporterInterface 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");
        }