示例#1
0
        private void TreeView_PreviewTextInput(object sender, TextCompositionEventArgs e)
        {
            for (int i = 0; i < TreeView.Items.Count; i++)
            {
                ArtistOverviewItem item = TreeView.Items[i] as ArtistOverviewItem;

                if (item.TextSearch.StartsWith(e.Text, StringComparison.CurrentCultureIgnoreCase))
                {
                    item.IsSelected = true;
                    item.IsExpanded = true;
                    break;
                }
            }
        }
示例#2
0
        private bool FilterArtistRow(ArtistOverviewItem artistRow)
        {
            if (string.IsNullOrEmpty(FilterString))
            {
                return(true);
            }

            string filterString = FilterString.ToLower();

            if (artistRow.Artist.IndexOf(filterString, StringComparison.InvariantCultureIgnoreCase) >= 0)
            {
                return(true);
            }

            return(false);
        }
示例#3
0
        internal bool FilterTreeRow(ArtistOverviewItem artistRow, string filterString)
        {
            if (FilterArtistRow(artistRow))
            {
                return(true);
            }

            foreach (object item in artistRow.Items)
            {
                ArtistOverviewCDItem cdItem = item as ArtistOverviewCDItem;

                if (cdItem != null && FilterTreeCDRow(cdItem, true))
                {
                    return(true);
                }
            }

            return(false);
        }