Ejemplo n.º 1
0
        private void CheckSpelling(SpellCheckProperty spellCheckProperty)
        {
            if (spellCheckProperty.HasNextMatch() == true)
            {
                System.Text.RegularExpressions.Match match = spellCheckProperty.GetNextMatch();
                bool correct = this.m_Hunspell.Spell(match.Value);
                if (correct == false)
                {
                    this.m_SuggestedWordList = this.m_Hunspell.Suggest(match.Value);
                    this.NotifyPropertyChanged("SuggestedWordList");

                    this.TextBoxText.Focus();
                    this.TextBoxText.SelectionStart  = match.Index;
                    this.TextBoxText.SelectionLength = match.Length;

                    this.m_CurrentSelectionStart  = match.Index;
                    this.m_CurrentSelectionLength = match.Length;

                    return;
                }
                else
                {
                    this.CheckSpelling(spellCheckProperty);
                }
            }
            else
            {
                //MessageBox.Show("All done.");
            }
        }
Ejemplo n.º 2
0
        public SpellCheckAccessionOrder(Business.Test.AccessionOrder accessionOrder)
        {
            this.m_PropertyList = new List <SpellCheckProperty>();
            YellowstonePathology.Business.Test.Surgical.SurgicalTestOrder surgicalTestOrder = accessionOrder.PanelSetOrderCollection.GetSurgical();

            PropertyInfo       clinicalInfoProperty = typeof(YellowstonePathology.Business.Test.AccessionOrder).GetProperty("ClinicalHistory");
            SpellCheckProperty clinicalInfo         = new SpellCheckProperty(clinicalInfoProperty, accessionOrder, "Clinical History");

            this.m_PropertyList.Add(clinicalInfo);

            PropertyInfo       grossXProperty = typeof(YellowstonePathology.Business.Test.Surgical.SurgicalTestOrder).GetProperty("GrossX");
            SpellCheckProperty grossX         = new SpellCheckProperty(grossXProperty, surgicalTestOrder, "Gross Description");

            this.m_PropertyList.Add(grossX);

            PropertyInfo       microscopicXProperty = typeof(YellowstonePathology.Business.Test.Surgical.SurgicalTestOrder).GetProperty("MicroscopicX");
            SpellCheckProperty microscopicX         = new SpellCheckProperty(microscopicXProperty, surgicalTestOrder, "Microscopic");

            this.m_PropertyList.Add(microscopicX);

            PropertyInfo       commentProperty = typeof(YellowstonePathology.Business.Test.Surgical.SurgicalTestOrder).GetProperty("Comment");
            SpellCheckProperty comment         = new SpellCheckProperty(commentProperty, surgicalTestOrder, "Comment");

            this.m_PropertyList.Add(comment);

            PropertyInfo       cancerSummaryProperty = typeof(YellowstonePathology.Business.Test.Surgical.SurgicalTestOrder).GetProperty("CancerSummary");
            SpellCheckProperty cancerSummary         = new SpellCheckProperty(cancerSummaryProperty, surgicalTestOrder, "Cancer Summary");

            this.m_PropertyList.Add(cancerSummary);

            foreach (YellowstonePathology.Business.Specimen.Model.SpecimenOrder specimenOrder in accessionOrder.SpecimenOrderCollection)
            {
                PropertyInfo       specimenDescriptionProperty = typeof(YellowstonePathology.Business.Specimen.Model.SpecimenOrder).GetProperty("Description");
                SpellCheckProperty specimenDescription         = new SpellCheckProperty(specimenDescriptionProperty, specimenOrder, "Specimen Description");
                this.m_PropertyList.Add(specimenDescription);
            }

            foreach (YellowstonePathology.Business.Test.Surgical.SurgicalSpecimen surgicalSpecimen in surgicalTestOrder.SurgicalSpecimenCollection)
            {
                PropertyInfo       diagnosisProperty = typeof(YellowstonePathology.Business.Test.Surgical.SurgicalSpecimen).GetProperty("Diagnosis");
                SpellCheckProperty diagnosis         = new SpellCheckProperty(diagnosisProperty, surgicalSpecimen, "Specimen Diagnosis");
                this.m_PropertyList.Add(diagnosis);

                foreach (YellowstonePathology.Business.SpecialStain.StainResultItem stainResultItem in surgicalSpecimen.StainResultItemCollection)
                {
                    PropertyInfo       stainResultProperty = typeof(YellowstonePathology.Business.SpecialStain.StainResultItem).GetProperty("Result");
                    SpellCheckProperty stainResult         = new SpellCheckProperty(stainResultProperty, stainResultItem, "Stain Result");
                    this.m_PropertyList.Add(stainResult);

                    PropertyInfo       stainCommentProperty = typeof(YellowstonePathology.Business.SpecialStain.StainResultItem).GetProperty("ReportComment");
                    SpellCheckProperty stainCommentResult   = new SpellCheckProperty(stainCommentProperty, stainResultItem, "Stain Comment");
                    this.m_PropertyList.Add(stainCommentResult);
                }
            }

            this.m_CurrentPropertyListIndex = -1;
            this.m_Regex = new System.Text.RegularExpressions.Regex(@"\b\w+\b");
        }
Ejemplo n.º 3
0
 private void ButtonNextProperty_Click(object sender, RoutedEventArgs e)
 {
     if (this.m_SpellCheckAccessionOrder.HasNextProperty() == true)
     {
         SpellCheckProperty spellCheckProperty = this.GetNextProperty();
         this.CheckSpelling(spellCheckProperty);
         this.ListViewProperties.SelectedIndex = this.m_SpellCheckAccessionOrder.CurrentPropertyListIndex;
     }
 }
Ejemplo n.º 4
0
        private void ListViewProperties_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (this.ListViewProperties.SelectedItem != null)
            {
                SpellCheckProperty spellCheckProperty = (SpellCheckProperty)this.ListViewProperties.SelectedItem;
                this.m_SpellCheckAccessionOrder.SetCurrentProperty(this.ListViewProperties.SelectedIndex);

                this.SetProperty(spellCheckProperty);
                this.CheckSpelling(spellCheckProperty);
            }
        }
Ejemplo n.º 5
0
        public SpellCheckAccessionOrder(Business.Test.AccessionOrder accessionOrder)
        {
            this.m_PropertyList = new List<SpellCheckProperty>();
            YellowstonePathology.Business.Test.Surgical.SurgicalTestOrder surgicalTestOrder = accessionOrder.PanelSetOrderCollection.GetSurgical();

            PropertyInfo clinicalInfoProperty = typeof(YellowstonePathology.Business.Test.AccessionOrder).GetProperty("ClinicalHistory");
            SpellCheckProperty clinicalInfo = new SpellCheckProperty(clinicalInfoProperty, accessionOrder, "Clinical History");
            this.m_PropertyList.Add(clinicalInfo);

            PropertyInfo grossXProperty = typeof(YellowstonePathology.Business.Test.Surgical.SurgicalTestOrder).GetProperty("GrossX");
            SpellCheckProperty grossX = new SpellCheckProperty(grossXProperty, surgicalTestOrder, "Gross Description");
            this.m_PropertyList.Add(grossX);

            PropertyInfo microscopicXProperty = typeof(YellowstonePathology.Business.Test.Surgical.SurgicalTestOrder).GetProperty("MicroscopicX");
            SpellCheckProperty microscopicX = new SpellCheckProperty(microscopicXProperty, surgicalTestOrder, "Microscopic");
            this.m_PropertyList.Add(microscopicX);

            PropertyInfo commentProperty = typeof(YellowstonePathology.Business.Test.Surgical.SurgicalTestOrder).GetProperty("Comment");
            SpellCheckProperty comment = new SpellCheckProperty(commentProperty, surgicalTestOrder, "Comment");
            this.m_PropertyList.Add(comment);

            PropertyInfo cancerSummaryProperty = typeof(YellowstonePathology.Business.Test.Surgical.SurgicalTestOrder).GetProperty("CancerSummary");
            SpellCheckProperty cancerSummary = new SpellCheckProperty(cancerSummaryProperty, surgicalTestOrder, "Cancer Summary");
            this.m_PropertyList.Add(cancerSummary);

            foreach (YellowstonePathology.Business.Specimen.Model.SpecimenOrder specimenOrder in accessionOrder.SpecimenOrderCollection)
            {
                PropertyInfo specimenDescriptionProperty = typeof(YellowstonePathology.Business.Specimen.Model.SpecimenOrder).GetProperty("Description");
                SpellCheckProperty specimenDescription = new SpellCheckProperty(specimenDescriptionProperty, specimenOrder, "Specimen Description");
                this.m_PropertyList.Add(specimenDescription);
            }

            foreach (YellowstonePathology.Business.Test.Surgical.SurgicalSpecimen surgicalSpecimen in surgicalTestOrder.SurgicalSpecimenCollection)
            {
                PropertyInfo diagnosisProperty = typeof(YellowstonePathology.Business.Test.Surgical.SurgicalSpecimen).GetProperty("Diagnosis");
                SpellCheckProperty diagnosis = new SpellCheckProperty(diagnosisProperty, surgicalSpecimen, "Specimen Diagnosis");
                this.m_PropertyList.Add(diagnosis);

                foreach(YellowstonePathology.Business.SpecialStain.StainResultItem stainResultItem in surgicalSpecimen.StainResultItemCollection)
                {
                    PropertyInfo stainResultProperty = typeof(YellowstonePathology.Business.SpecialStain.StainResultItem).GetProperty("Result");
                    SpellCheckProperty stainResult = new SpellCheckProperty(stainResultProperty, stainResultItem, "Stain Result");
                    this.m_PropertyList.Add(stainResult);

                    PropertyInfo stainCommentProperty = typeof(YellowstonePathology.Business.SpecialStain.StainResultItem).GetProperty("ReportComment");
                    SpellCheckProperty stainCommentResult = new SpellCheckProperty(stainCommentProperty, stainResultItem, "Stain Comment");
                    this.m_PropertyList.Add(stainCommentResult);
                }
            }

            this.m_CurrentPropertyListIndex = -1;
            this.m_Regex = new System.Text.RegularExpressions.Regex(@"\b\w+\b");
        }
Ejemplo n.º 6
0
 private SpellCheckProperty GetNextProperty()
 {
     if (this.m_SpellCheckAccessionOrder.HasNextProperty() == true)
     {
         SpellCheckProperty spellCheckProperty = this.m_SpellCheckAccessionOrder.GetNextProperty();
         this.SetProperty(spellCheckProperty);
         return(spellCheckProperty);
     }
     else
     {
         //MessageBox.Show("You have reached the end.");
         return(null);
     }
 }
Ejemplo n.º 7
0
        private void ButtonSkip_Click(object sender, RoutedEventArgs e)
        {
            if (this.m_SpellCheckAccessionOrder.CurrentPropertyListIndex > -1)
            {
                this.m_SuggestedWordList = new List <string>();
                this.NotifyPropertyChanged("SuggestedWordList");
                this.m_SpellCheckAccessionOrder.Skip();

                SpellCheckProperty spellCheckProperty = this.m_SpellCheckAccessionOrder.GetCurrentProperty();
                if (spellCheckProperty.HasNextMatch() == true)
                {
                    this.CheckSpelling(spellCheckProperty);
                }
            }
        }
Ejemplo n.º 8
0
        private void ListView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (this.ListViewSuggestedWordList.SelectedItems.Count != 0)
            {
                string selectedWord = (string)this.ListViewSuggestedWordList.SelectedItem;
                this.m_Text = this.m_Text.Remove(this.m_CurrentSelectionStart, this.m_CurrentSelectionLength);
                this.m_Text = this.m_Text.Insert(this.m_CurrentSelectionStart, selectedWord);
                this.m_SuggestedWordList = new List <string>();

                this.NotifyPropertyChanged("Text");
                this.NotifyPropertyChanged("SuggestedWordList");

                SpellCheckProperty spellCheckProperty = this.m_SpellCheckAccessionOrder.GetCurrentProperty();
                spellCheckProperty.Reset(this.m_Text);
                this.CheckSpelling(spellCheckProperty);
            }
        }
Ejemplo n.º 9
0
 private void SetProperty(SpellCheckProperty spellCheckProperty)
 {
     this.m_Text = spellCheckProperty.GetText();
     this.Title = spellCheckProperty.Description;
     this.NotifyPropertyChanged("Text");
 }
Ejemplo n.º 10
0
        private void CheckSpelling(SpellCheckProperty spellCheckProperty)
        {
            if(spellCheckProperty.HasNextMatch() == true)
            {
                System.Text.RegularExpressions.Match match = spellCheckProperty.GetNextMatch();
                bool correct = this.m_Hunspell.Spell(match.Value);
                if (correct == false)
                {
                    this.m_SuggestedWordList = this.m_Hunspell.Suggest(match.Value);
                    this.NotifyPropertyChanged("SuggestedWordList");

                    this.TextBoxText.Focus();
                    this.TextBoxText.SelectionStart = match.Index;
                    this.TextBoxText.SelectionLength = match.Length;

                    this.m_CurrentSelectionStart = match.Index;
                    this.m_CurrentSelectionLength = match.Length;

                    return;
                }
                else
                {
                    this.CheckSpelling(spellCheckProperty);
                }
            }
            else
            {
                //MessageBox.Show("All done.");
            }
        }
Ejemplo n.º 11
0
 private void SetProperty(SpellCheckProperty spellCheckProperty)
 {
     this.m_Text = spellCheckProperty.GetText();
     this.Title  = spellCheckProperty.Description;
     this.NotifyPropertyChanged("Text");
 }