Esempio n. 1
0
 private void OnResultsListItemsSelected(object sender, MouseEventArgs e)
 {
     if (m_resultsList.SelectedItems?.Count > 0)
     {
         SearchMenuViewCLIMethods.HandleSearchItemSelected(m_nativeCallerPointer, m_resultsList.SelectedIndex);
     }
 }
Esempio n. 2
0
        private void OnKeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                string queryText = m_editText.Text;

                if (queryText.Length > 0)
                {
                    SearchMenuViewCLIMethods.PerformedSearchQuery(m_nativeCallerPointer, queryText);

                    m_resultsSpinner.Visibility     = Visibility.Visible;
                    m_resultsClearButton.Visibility = Visibility.Hidden;

                    m_searchInFlight = true;
                }
            }
        }
Esempio n. 3
0
        private void OnKeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                Encoding enc       = Encoding.GetEncoding("Windows-1252");
                byte[]   bytes     = Encoding.UTF8.GetBytes(m_editText.Text);
                string   queryText = enc.GetString(bytes);

                if (queryText.Length > 0)
                {
                    SearchMenuViewCLIMethods.PerformedSearchQuery(m_nativeCallerPointer, queryText);

                    m_resultsSpinner.Visibility     = Visibility.Visible;
                    m_resultsClearButton.Visibility = Visibility.Hidden;

                    m_searchInFlight = true;
                }
            }
        }
Esempio n. 4
0
        private void ClearSearch()
        {
            m_hasResults        = false;
            m_hasCategorySearch = false;

            if (m_resultsList.Items?.Count > 0)
            {
                SearchMenuViewCLIMethods.OnSearchCleared(m_nativeCallerPointer);
            }
            else
            {
                m_editText.Text = string.Empty;
            }

            ClearSearchResultsListBox();

            m_editText.Text       = m_defaultEditText;
            m_editText.Foreground = Colour.darkgrey;
        }
Esempio n. 5
0
        private void OnMenuListItemSelected(object sender, MouseEventArgs e)
        {
            if (m_searchInFlight || IsAnimating() || m_adapter.IsAnimating())
            {
                (sender as ListBox).SelectedItem = null;
                return;
            }

            var item = m_list.SelectedItem as MenuListItem;

            if (item != null)
            {
                var sectionChildIndices = m_adapter.GetSectionAndChildIndicesFromSelection(m_list.SelectedIndex);

                if (item.IsExpandable)
                {
                    SearchMenuViewCLIMethods.OnSearchCleared(m_nativeCallerPointer);
                }

                MenuViewCLIMethods.SelectedItem(m_nativeCallerPointer, sectionChildIndices.Item1, sectionChildIndices.Item2);
            }
        }