// Token: 0x060057F3 RID: 22515 RVA: 0x00185B20 File Offset: 0x00183D20
        internal bool DoSearch(string nextChar)
        {
            bool           lookForFallbackMatchToo = false;
            int            num   = 0;
            ItemCollection items = this._attachedTo.Items;

            if (this.IsActive)
            {
                num = this.MatchedItemIndex;
            }
            if (this._charsEntered.Count > 0 && string.Compare(this._charsEntered[this._charsEntered.Count - 1], nextChar, true, TextSearch.GetCulture(this._attachedTo)) == 0)
            {
                lookForFallbackMatchToo = true;
            }
            string primaryTextPath = TextSearch.GetPrimaryTextPath(this._attachedTo);
            bool   flag            = false;
            int    num2            = TextSearch.FindMatchingPrefix(this._attachedTo, primaryTextPath, this.Prefix, nextChar, num, lookForFallbackMatchToo, ref flag);

            if (num2 != -1)
            {
                if (!this.IsActive || num2 != num)
                {
                    object item = items[num2];
                    this._attachedTo.NavigateToItem(item, num2, new ItemsControl.ItemNavigateArgs(Keyboard.PrimaryDevice, ModifierKeys.None));
                    this.MatchedItemIndex = num2;
                }
                if (flag)
                {
                    this.AddCharToPrefix(nextChar);
                }
                if (!this.IsActive)
                {
                    this.IsActive = true;
                }
            }
            if (this.IsActive)
            {
                this.ResetTimeout();
            }
            return(num2 != -1);
        }
        // Token: 0x060057F7 RID: 22519 RVA: 0x00185E84 File Offset: 0x00184084
        internal static MatchedTextInfo FindMatchingPrefix(ItemsControl itemsControl, string prefix)
        {
            bool            flag = false;
            int             num  = TextSearch.FindMatchingPrefix(itemsControl, TextSearch.GetPrimaryTextPath(itemsControl), prefix, string.Empty, 0, false, ref flag);
            MatchedTextInfo result;

            if (num >= 0)
            {
                CultureInfo culture = TextSearch.GetCulture(itemsControl);
                bool        isTextSearchCaseSensitive = itemsControl.IsTextSearchCaseSensitive;
                string      primaryTextFromItem       = TextSearch.GetPrimaryTextFromItem(itemsControl, itemsControl.Items[num]);
                int         matchedPrefixLength;
                int         textExcludingPrefixLength;
                TextSearch.GetMatchingPrefixAndRemainingTextLength(primaryTextFromItem, prefix, culture, !isTextSearchCaseSensitive, out matchedPrefixLength, out textExcludingPrefixLength);
                result = new MatchedTextInfo(num, primaryTextFromItem, matchedPrefixLength, textExcludingPrefixLength);
            }
            else
            {
                result = MatchedTextInfo.NoMatch;
            }
            return(result);
        }