private void BoxOnFilterTextChanged(FilterTextChangedEventArgs e)
        {
            try
            {
                // Do we want to handle this request?
                if (!UseDeferredFiltering)
                {
                    return;
                }

                /* Kick off the process on a new thread. This isn't strictly necessary since the text box's eventing is
                 * multithreaded, but simulates an asynchronous filter process.
                 *
                 * In production situations, it may be prudent to cancel any pending filter operations before kicking off a
                 * new one. The control will handle outdated responses (via GUID matching) without issue, but canceling any
                 * long running filter processes might be prudent here.
                 */
                var t = new Thread(Filter);
                t.Start(e);

                // Mark it as handled
                e.DeferFiltering = true;
                e.Handled        = true;

                // If we need to, adjust the timeout duration
                //e.FilterWaitTimeoutMs = 10000;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
 private void FilterTextChanged(Object sender, FilterTextChangedEventArgs args)
 {
     if (args.FilterText != "")
     {
         EnableFilter(args.FilterText);
     }
     else
     {
         DisableFilter();
     }
 }
Exemple #3
0
 public void FilterForTransferAsync(FilterTextChangedEventArgs e)
 {
     using (Trace.Main.scope())
     {
         try
         {
             // Start filter process async
             var t = new Thread(FilterForTransfer);
             t.Start(e);
         }
         catch (Exception ex)
         {
             Console.WriteLine(ex);
             Trace.Main.exception(ex, ex.Message);
         }
     }
 }
        private void AutoCompleteTextBox_OnFilterTextChanged(FilterTextChangedEventArgs e)
        {
            try
            {
                // Update args
                e.Handled             = true;
                e.DeferFiltering      = true;
                e.FilterWaitTimeoutMs = 10000;

                // Call filter async method
                VidyoPanelViewModel.Instance.FilterForTransferAsync(e);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                Trace.Main.exception(ex);
            }
        }