Provides data for the E:System.Windows.Controls.AutoCompleteBox.Populating event.
Inheritance: System.Windows.RoutedEventArgs
Esempio n. 1
0
        private void cbStringIDs_Populating(object sender, PopulatingEventArgs e)
        {
            e.Cancel = true;

            cbStringIDs.ItemsSource = SearchTrie.FindPrefix(e.Parameter);
            cbStringIDs.PopulateComplete();
        }
 protected override void OnPopulating(PopulatingEventArgs e)
 {
     if (((App)Application.Current).Database == null) return;
     var kwrds = new List<string>();
     foreach (Keyword keyword in ((App)Application.Current).Database.GetKeywords(Text))
         kwrds.Add(keyword.NormalForm);
     ItemsSource = kwrds;
 }
Esempio n. 3
0
		private void textbox_Populating(object sender, PopulatingEventArgs e)
		{
			e.Cancel = true;
			if (SearchTrie != null)
			{
				textbox.ItemsSource = SearchTrie.FindPrefix(e.Parameter);
				textbox.PopulateComplete();
			}
		}
Esempio n. 4
0
		private void AutoCompleteBox_Populating(object sender, PopulatingEventArgs e)
		{
			var zones = new List<string>();
			foreach (var zone in FiresecManager.Zones)
			{
				zones.Add(zone.Name);
			}
			AutoCompleteBox autoCompleteBox = sender as AutoCompleteBox;
			autoCompleteBox.ItemsSource = zones;
		}
        /// <summary>
        /// The Populating event handler.
        /// </summary>
        /// <param name="sender">The source object.</param>
        /// <param name="e">The event data.</param>
        private void OnPopulatingSynchronous(object sender, PopulatingEventArgs e)
        {
            AutoCompleteBox source = (AutoCompleteBox)sender;

            source.ItemsSource = new string[]
            {
                e.Parameter + "1",
                e.Parameter + "2",
                e.Parameter + "3",
            };
        }
        /// <summary>
        /// Handle and cancel the Populating event, and kick off the web service
        /// request.
        /// </summary>
        /// <param name="sender">The source object.</param>
        /// <param name="e">The event data.</param>
        private void Search_Populating(object sender, PopulatingEventArgs e)
        {
            AutoCompleteBox autoComplete = (AutoCompleteBox)sender;

            // Allow us to wait for the response
            e.Cancel = true;

            // Create a request for suggestion
            WebClient wc = new WebClient();
            wc.DownloadStringCompleted += OnDownloadStringCompleted;
            wc.DownloadStringAsync(WebServiceHelper.CreateWebSearchSuggestionsUri(autoComplete.SearchText), autoComplete);
        }
Esempio n. 7
0
		void Description_Populating(object sender, PopulatingEventArgs e)
		{
			var result = new List<string>();
			foreach (var zone in FiresecManager.Zones)
			{
				result.Add(zone.Description);
			}
			AutoCompleteBox autoCompleteBox = sender as AutoCompleteBox;
			if (autoCompleteBox != null)
			{
				autoCompleteBox.ItemsSource = result;
			}
		}
        /// <summary>
        /// The populating handler.
        /// </summary>
        /// <param name="sender">The source object.</param>
        /// <param name="e">The event data.</param>
        private void OnPopulatingAsynchronous(object sender, PopulatingEventArgs e)
        {
            AutoCompleteBox source = (AutoCompleteBox)sender;

            // Cancel the populating value: this will allow us to call 
            // PopulateComplete as necessary.
            e.Cancel = true;
            
            // Use the dispatcher to simulate an asynchronous callback when 
            // data becomes available
            Dispatcher.BeginInvoke(
                delegate
                {
                    source.ItemsSource = new string[]
                    {
                        e.Parameter + "1",
                        e.Parameter + "2",
                        e.Parameter + "3",
                    };

                    // Population is complete
                    source.PopulateComplete();
                });
        }
Esempio n. 9
0
        /// <summary>
        /// Handles the timer tick when using a populate delay.
        /// </summary>
        /// <param name="sender">The source object.</param>
        /// <param name="e">The event arguments.</param>
        private void PopulateDropDown(object sender, EventArgs e)
        {
            if (_delayTimer != null)
            {
                _delayTimer.Stop();
            }

            // Update the prefix/search text.
            SearchText = Text;

            // The Populated event enables advanced, custom filtering. The 
            // client needs to directly update the ItemsSource collection or
            // call the Populate method on the control to continue the 
            // display process if Cancel is set to true.
#if SILVERLIGHT
            PopulatingEventArgs populating = new PopulatingEventArgs(SearchText);
#else
            PopulatingEventArgs populating = new PopulatingEventArgs(SearchText, PopulatingEvent);
#endif

            OnPopulating(populating);
            if (!populating.Cancel)
            {
                PopulateComplete();
            }
        }
Esempio n. 10
0
 private void AcPopulating(object sender, PopulatingEventArgs e)
 {
     e.Cancel = true;
     ViewModel.SuburbSearchParameter = ac.SearchText;
     ViewModel.GetSuburbs();
 }
 private void TitleBoxPopulating(object sender, PopulatingEventArgs e)
 {
     TitleBox.ItemsSource = Titles;
     TitleBox.PopulateComplete();
 }
 private void ActorBoxPopulating(object sender, PopulatingEventArgs e)
 {
     ActorBox.ItemsSource = Actors;
     ActorBox.PopulateComplete();
 }
 private void TbInput_OnPopulating(object sender,  PopulatingEventArgs e)
 {
 }
        private void TextBoxTypeValue_Populating(object sender, PopulatingEventArgs e)
        {
            if (TextBoxTypeValue.Text.Length != 3)
            {
                e.Handled = true;
                return;
            }

            ClauseKeyword keyword = ((ClauseKeywordItem)ComboBoxType.SelectedItem).ClauseKeyword;
            string term = TextBoxTypeValue.Text.Trim();

            List<SongSearchResult> searchList;
            List<String> resultList = new List<string>();

            switch (keyword)
            {
                case (ClauseKeyword.Artist):
                    searchList = DJModel.Instance.GetMatchingArtistsInSongbook(term);
                    foreach (SongSearchResult result in searchList)
                    {
                        string r = result.MainResult;
                        if (!resultList.Contains(r))
                            resultList.Add(r);
                    }
                    break;
                case (ClauseKeyword.Title):
                    searchList = DJModel.Instance.GetMatchingTitlesInSongbook(term);
                    foreach (SongSearchResult result in searchList)
                    {
                        string r = result.MainResult;
                        if (!resultList.Contains(r))
                            resultList.Add(r);
                    }
                    break;
                case (ClauseKeyword.SongID):
                    searchList = DJModel.Instance.GetMatchingSongsInSongbook(term);
                    TextBoxTypeValue.ItemsSource = searchList;
                    return;
            }

            resultList.Sort();
            TextBoxTypeValue.ItemsSource = resultList;

            e.Handled = true;
        }
Esempio n. 15
0
        private void TaskPopulator(object sender, PopulatingEventArgs e)
        {
            try
            {

                AutoCompleteBox control = (AutoCompleteBox)sender;

                if (this.AllContainer._employeeslist.Count == 0)
                {
                    RefreshContainer();
                }

                try
                {
                    // get the project from the text box
                    try
                    {
                        // get a list of all projects
                        var projectresult = from item in AllContainer._projectlist
                                            where (item.project_name.ToLower().Contains(this.AssignTaskMaterialsProjectNameTextBox.Text.ToLower()))
                                            select item;
                        if (projectresult != null)
                        {
                            // get the first project
                            projects p = (projects)projectresult.ToList().First();

                            // get the list of tasks with its id
                            var taskresult = from item in AllContainer._tasklist
                                             where ((item.task_name.ToLower().Contains(control.Text.ToLower())) && (item.project_id == p.project_id))
                                             select item;

                            control.ItemsSource = (from _task in (List<task>)taskresult.ToList() select (_task.task_name)).ToList();
                            control.PopulateComplete();
                            sender = control;
                        }
                    }
                    catch { }
                }
                catch { }

            }
            catch { }
        }
 /// <summary>
 /// Raises the
 /// <see cref="E:System.Windows.Controls.AutoCompleteBox.Populating" />
 /// event.
 /// </summary>
 /// <param name="e">A
 /// <see cref="T:System.Windows.Controls.PopulatingEventArgs" /> that
 /// contains the event data.</param>
 protected virtual void OnPopulating(PopulatingEventArgs e)
 {
     PopulatingEventHandler handler = Populating;
     if (handler != null)
     {
         handler(this, e);
     }
 }
Esempio n. 17
0
        private void autoCompleteCliente_Populating(object sender, PopulatingEventArgs e)
        {
            List<Cliente> clist = dag.cercaClientiByCognome(autoCompleteCliente.Text);
            clientiDaPrefix = new ObservableCollection<Cliente>(clist);
            autoCompleteCliente.ItemsSource = clientiDaPrefix;

            autoCompleteCliente.PopulateComplete();
        }
Esempio n. 18
0
 private void subjectAutoCompleteBox_Populating(object sender, PopulatingEventArgs e)
 {
     var auto = sender as AutoCompleteBox;
     if (auto != null)
     {
         e.Cancel = true;
         viewModel.SubjectItems.Clear();
         for (int i = 0; i < 100; i++)
         {
             viewModel.SubjectItems.Add(new AutoCompleteModel()
             {
                 Id = i,
                 Code = "010" + i,
                 Name = "abc" + i,
                 SerchString = e.Parameter
             });
         }
         auto.ItemsSource = viewModel.SubjectItems;
         auto.FilterMode = AutoCompleteFilterMode.Custom;
         auto.PopulateComplete();
     }
 }
 private void txtEndCustomer_Populating(object sender, PopulatingEventArgs e)
 {
     var ctx = new RadiographyContext();
     if (RGReport != null)
         ctx.GetEndCustomerNames(EndCustomerNames_Loaded, null);
 }
Esempio n. 20
0
        private void autoCompRoomNumber_Populating(object sender, PopulatingEventArgs e)
        {
            if (!context.IsLoading)
            {
                loadOpView = context.Load(context.GetViewSpaGuestReservationQuery(autoCompRoomNumber.Text), false);
                loadOpView.Completed += loadOpView_Completed;

            }
        }
Esempio n. 21
0
        private void ComboboxPopulating(object sender, PopulatingEventArgs e)
        {
            try
            {
                ComboBox control = (ComboBox)sender;

                if (this.AllContainer._employeeslist.Count == 0)
                {
                    RefreshContainer();
                }

                switch (control.Tag.ToString())
                {
                    case Constants.employees:
                        try
                        {
                            // get a list of jobs
                            var result = from item in AllContainer._employeeslist
                                         select item;
                            //List<employees> c = (List<employees>)result.ToList();
                            List<string> names = (from n in (List<employees>)result.ToList() select (n.employee_name)).ToList();
                            if (result != null)
                            {
                                control.ItemsSource = names;
                                //control.PopulateComplete();
                                sender = control;
                            }
                            else
                            {
                                // show all

                                control.ItemsSource = (from n in AllContainer._employeeslist select (n.employee_name)).ToList();
                                //control.PopulateComplete();
                                sender = control;
                            }

                        }
                        catch { }
                        break;

                    case Constants.Job_Type:
                        try
                        {
                            var result = from item in AllContainer._job_typelist
                                         select item;
                            List<string> names = (from n in (List<job_type>)result.ToList() select (n.job_name)).ToList();
                            if (result != null)
                            {
                                control.ItemsSource = names;
                                //control.PopulateComplete();
                                sender = control;
                            }
                            else
                            {
                                // show all
                                names = (from n in AllContainer._job_typelist select (n.job_name)).ToList();
                                control.ItemsSource = names;
                                //control.PopulateComplete();
                                sender = control;
                            }
                        }
                        catch { }
                        break;
                    case Constants.Client:
                        try
                        {
                            // get a list of client names
                            var result = from item in AllContainer._clientlist
                                         select item;
                            List<string> names = (from _client in (List<clients>)result.ToList() select (_client.client_name)).ToList();
                            if (result != null)
                            {
                                control.ItemsSource = names;
                                //control.PopulateComplete();
                                sender = control;
                            }
                        }
                        catch { }
                        break;

                    case Constants.Project:
                        try
                        {
                            // get a list of all projects
                            var result = from item in AllContainer._projectlist
                                         select item;
                            if (result != null)
                            {
                                control.ItemsSource = (from _project in (List<projects>)result.ToList() select (_project.project_name)).ToList();
                                //control.PopulateComplete();
                                sender = control;
                            }
                        }
                        catch { }
                        break;
                    case Constants.Materials:
                        try
                        {
                            // get the list of all materials
                            var result = from item in AllContainer._materialslist
                                         select item;
                            if (result != null)
                            {
                                control.ItemsSource = (from _mat in (List<materials>)result.ToList() select (_mat.material_name)).ToList();
                                //control.PopulateComplete();
                                sender = control;
                            }
                        }
                        catch { }
                        break;
                }
            }
            catch { }
        }
Esempio n. 22
0
        /// <summary>
        /// Raises the
        /// <see cref="E:System.Windows.Controls.AutoCompleteBox.Populating" />
        /// event.
        /// </summary>
        /// <param name="e">A
        /// <see cref="T:System.Windows.Controls.PopulatingEventArgs" /> that
        /// contains the event data.</param>
        protected virtual void OnPopulating(PopulatingEventArgs e)
        {
#if SILVERLIGHT
            PopulatingEventHandler handler = Populating;
            if (handler != null)
            {
                handler(this, e);
            }
#else
            RaiseEvent(e);
#endif
        }
Esempio n. 23
0
 private void WordAutoCompleteBox_OnPopulating(object sender, PopulatingEventArgs e)
 {
     var client = new PersonServiceSoapClient();
     client.GetPersonsCompleted += GetPersonsCompleted;
     client.GetPersonsAsync();
 }
Esempio n. 24
0
 void autoComPersonelAdi_Populating(object sender, PopulatingEventArgs e)
 {
     if (!ds.IsLoading)
     {
         //LoadOperation<DbPersonel> loadOp = ds.Load(ds.GetPersonelByPersonelAdiQuery(autoComPersonelAdi.Text.ToUpper()), false);
         //listboxPersonelEkle.ItemsSource = loadOp.Entities;
         loadOpPerView = ds.Load(ds.GetViewPersonelProfilQuery(autoComPersonelAdi.Text.ToUpper()));
         loadOpPerView.Completed += loadOpPerView_Completed;
     }
 }
Esempio n. 25
0
        private void AutoCompleteBox_Populating(object sender, PopulatingEventArgs e)
        {
            try
            {
                var auto = (e.Source as AutoCompleteBox);
                string text = auto.Text;
                string dirname = System.IO.Path.GetDirectoryName(text);

                if (auto.Name == "txtOrigen")
                    this.publishVM.sOrigen = auto.Text;
                else if (auto.Name == "txtDestino")
                    this.publishVM.sDestino = auto.Text;

                if (dirname != "" && Directory.Exists(System.IO.Path.GetDirectoryName(dirname)))
                {
                    string[] files = Directory.GetFiles(dirname, "*.*", SearchOption.TopDirectoryOnly);
                    string[] dirs = Directory.GetDirectories(dirname, "*.*", SearchOption.TopDirectoryOnly);
                    var candidates = new List<string>();

                    Array.ForEach(new String[][] { files, dirs }, (x) =>
                        Array.ForEach(x, (y) =>
                        {
                            if (y.StartsWith(dirname, StringComparison.CurrentCultureIgnoreCase))
                                candidates.Add(y);
                        }));

                    auto.ItemsSource = candidates;
                    auto.PopulateComplete();
                }
            }
            catch (Exception ex)
            {
                this.publishVM.sStatus = ex.Message;
            }
        }
Esempio n. 26
0
        private async void Box_Populating( object sender, PopulatingEventArgs e )
        {
            if ( AutoCompleteProvider == null )
            {
                return;
            }

            e.Cancel = true;
            try
            {
                Box.ItemsSource = await AutoCompleteProvider( Query );
            }
            catch
            {
                // nothing
            }

            Box.PopulateComplete();
        }
Esempio n. 27
0
        void OnMetadataBoxPopulating(object sender, PopulatingEventArgs e)
        {
            var box = (AutoCompleteBox)sender;
            var encodeInfo = (EncodeInfo)box.DataContext;

            e.Cancel = true;

            CancellationToken token;
            Task<object[]> task = encodeInfo.StartQueryMetadata(box.SearchText, out token);
            task.ContinueWith(t => Dispatcher.BeginInvoke(UpdateQueryResults, box, t, token), token);
        }