예제 #1
0
        /// <summary>
        /// Queries the posts in memory on tries (SearchTrie field)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void searchBarInput_KeyDown(object sender, KeyEventArgs e)
        {
            var input = searchBarInput.Text;

            if (input == "")
            {
                GridControlResults.DataSource = _dataConnection.GetRepository();
                UpdateNumberOfRecords();
                //To update Datasource from db
                //GridControlResults.DataSource = _dataConnection.GetPostList(null);
                return;
            }

            if (e.KeyCode == Keys.Enter)
            {
                GridControlResults.DataSource = _dataConnection.SearchPost(input, checkBox1.Checked);
                //14 ms
            }
            UpdateNumberOfRecords();
        }