Пример #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            CommonLibrary.AppConfig appConfig = new CommonLibrary.AppConfig(BusinessLayer.Constants.CONGIF_FILE);
            lbOrganisationName.Text = appConfig.GetValue("OrganisationName");
            try
            {
                Uri         imageUri = new Uri(appConfig.GetValue("OrganisationLogo"));
                BitmapImage bi       = new BitmapImage(new Uri(appConfig.GetValue("OrganisationLogo"), UriKind.RelativeOrAbsolute));
                imgLogo.Source = bi;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Invalid Path of Logo");
            }



            contacts = searcher.SearchAll();

            var x = from u in contacts select u.Key;

            foreach (string st in x)
            {
                lbName.Items.Add(st);
            }
        }
Пример #2
0
        private void QuickSearchForm_Load(object sender, EventArgs e)
        {
            contacts = searcher.SearchAll();

            var x = from u in contacts select u.Key;

            lbName.Items.AddRange(x.ToArray());
        }
Пример #3
0
        private void SearchAllContact()
        {
            contacts = searcher.SearchAll();

            var x = from u in contacts select u.Key;

            foreach (string st in x)
            {
                lbName.Items.Add(st);
            }
            //t.Abort();
        }
Пример #4
0
        /// <summary>
        /// Runs on secondary thread.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <remarks></remarks>
        private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            //Search through all contact and get result
            //e.Result = this.SomeLongRunningMethodWPF();
            searcher.SearchAll();


            // Cancel if cancel button was clicked.
            if (this.backgroundWorker.CancellationPending)
            {
                e.Cancel = true;
                return;
            }
        }