示例#1
0
        /// <summary>
        /// Searches this instance.
        /// </summary>
        private void Search()
        {
            if (this.SingleConceptMatching.InputBoxText != this.lastInputBoxSearch)
            {
                this.lastInputBoxSearch = this.SingleConceptMatching.InputBoxText;

                if (this.connected)
                {
                    if (!SingleConceptMatchingPage.ValidateInputText(this.SingleConceptMatching.InputBoxText))
                    {
                        this.StatusText.Text = SingleConceptMatchingPage.InputTextValidationFailed;
                        return;
                    }

                    this.StatusText.Text = SingleConceptMatchingPage.SearchInProgressText;
                    this.ShowProgressBar();

                    this.SingleConceptMatching.InputBoxItemsSource = null;

                    FilterItem filterItem = this.SingleConceptMatching.SubsetPickerSelectedItem as FilterItem;

                    TerminologyManager.SearchInputField(SingleConceptMatchingPage.FixupInputText(this.SingleConceptMatching.InputBoxText), filterItem.SubsetCollection);
                }
            }
            else if (this.lastInputBoxResults != null && this.SingleConceptMatching.InputBoxText == this.lastInputBoxResults.SearchTextOriginal)
            {
                this.SingleConceptMatching.InputBoxItemsSource = this.lastInputBoxResults.InputFieldResults;
            }
        }
示例#2
0
        /// <summary>
        /// Handles the InputFieldTextChanged event of the SingleConceptMatching control.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Windows.Controls.TextChangedEventArgs"/> instance containing the event data.</param>
        private void SingleConceptMatching_InputBoxTextChanged(object sender, TextChangedEventArgs e)
        {
            this.SingleConceptMatching.InputBoxItemsSource = null;
            this.encodableInputFieldTimer.Stop();

            if (this.connected)
            {
                this.StatusText.Text = string.Empty;
            }

            this.HideProgressBar();

            if (!SingleConceptMatchingPage.ValidateInputText(this.SingleConceptMatching.InputBoxText))
            {
                return;
            }

            switch (SingleConceptMatchingPage.searchMode)
            {
            case SearchMode.Progressive:
                if (!this.encodableInputFieldTimer.IsEnabled)
                {
                    this.encodableInputFieldTimer.Start();
                }

                break;

            case SearchMode.UserInitiated:
                break;

            default:
                break;
            }
        }
示例#3
0
 /// <summary>
 /// Handles the encode completed event of the Terminology Manager.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EncodeConceptCompletedEventArgs"/> instance containing the event data.</param>
 private void TerminologyManagerEncodeConceptCompleted(object sender, EncodeConceptCompletedEventArgs e)
 {
     if (e.Successful)
     {
         this.StatusText.Text = string.Empty;
         this.EncodeOutput(e.EncodedConcept);
     }
     else
     {
         this.StatusText.Text = NoMatchesFoundDueToErrorText;
         this.EncodeOutput(SingleConceptMatchingPage.CreateUnencodedConcept(this.SingleConceptMatching.InputBoxText));
     }
 }
示例#4
0
        /// <summary>
        /// Handles the input box search completed event of the Terminology Manager.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="InputFieldSearchCompletedEventArgs"/> instance containing the event data.</param>
        private void TerminologyManagerInputBoxSearchCompleted(object sender, InputFieldSearchCompletedEventArgs e)
        {
            // Check search is for the latest value in the text box
            if (SingleConceptMatchingPage.FixupInputText(this.SingleConceptMatching.InputBoxText) != e.SearchTextOriginal)
            {
                return;
            }

            if (e.Successful)
            {
                if (e.InputFieldResults != null && e.InputFieldResults.Count > 0)
                {
                    this.lastInputBoxResults = e;
                    this.SingleConceptMatching.InputBoxItemsSource = e.InputFieldResults;

                    if (e.ExceedsMaxTotal)
                    {
                        this.StatusText.Text = string.Format(System.Globalization.CultureInfo.CurrentCulture, SingleConceptMatchingPage.MoreMatchesFoundText, e.InputFieldResults.Count);
                    }
                    else
                    {
                        this.StatusText.Text = string.Format(System.Globalization.CultureInfo.CurrentCulture, SingleConceptMatchingPage.MatchesFound, e.InputFieldResults.Count);
                    }
                }
                else
                {
                    this.StatusText.Text = SingleConceptMatchingPage.NoMatchesFoundText;
                }
            }
            else
            {
                this.StatusText.Text = SingleConceptMatchingPage.NoMatchesFoundDueToErrorText;
            }

            this.HideProgressBar();
        }