示例#1
0
        /// <summary>
        /// Runs Selected AddIn new thread
        /// </summary>
        private void RunBackgroundAddIn()
        {
            // Do the work.
            List <int> numbersProcessed = addin.ProcessNumbers(1, 20);

            // update UI on UI thread
            this.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
                                        (ThreadStart) delegate()
            {
                lstNumbers.ItemsSource = numbersProcessed;
                progressBar.Value      = 0;

                // Release the add-in
                addin = null;
            }
                                        );
        }