コード例 #1
0
        private void refreshFilter(string text)
        {
            bool cute    = checkCute.IsChecked.Value;
            bool cool    = checkCool.IsChecked.Value;
            bool passion = checkPassion.IsChecked.Value;

            string filter = Parser.DivideKorean(text);

            int count = 0;

            for (int i = 0; i < gridContent.Children.Count; i++)
            {
                IdolView view   = (IdolView)gridContent.Children[i];
                bool     isShow = false;

                switch (view.getIdolType())
                {
                case Type.Cute:
                    isShow = view.getVisibility(cute, filter);
                    break;

                case Type.Cool:
                    isShow = view.getVisibility(cool, filter);
                    break;

                case Type.Passion:
                    isShow = view.getVisibility(passion, filter);
                    break;
                }

                if (!isShow)
                {
                    view.Margin     = new Thickness(0, 0, 0, 0);
                    view.Visibility = Visibility.Hidden;
                }
                else
                {
                    view.Visibility = Visibility.Visible;
                    view.Margin     = new Thickness(70 * (count % 8), 70 * (count / 8), 0, 0);
                    count++;
                }
            }
        }
コード例 #2
0
        private void refresh(string text)
        {
            gridContent.Children.Clear();
            DictView.Clear();

            for (int i = 0; i < Data.Idols.Count; i++)
            {
                Idol idol = Data.Idols[i];

                IdolView view = new IdolView(idol, Data.GetCount(idol.Id));
                view.Margin        = new Thickness(70 * (i % 8), 70 * (i / 8), 0, 0);
                view.CheckChanged += CheckChanged;

                gridContent.Children.Add(view);
                DictView.Add(idol.Id, view);
            }

            refreshCount();
            refreshFilter(text);
        }
コード例 #3
0
        private void addAllIdol(int cnt)
        {
            gridContent.Children.Clear();
            DictView.Clear();

            for (int i = 0; i < Data.Idols.Count; i++)
            {
                Idol idol = Data.Idols[i];
                if (idol.Rarity == Rarity.SSR)
                {
                    Data.ApplyCount(idol.Id, cnt);
                }

                IdolView view = new IdolView(idol, Data.GetCount(idol.Id));
                view.Margin        = new Thickness(70 * (i % 8), 70 * (i / 8), 0, 0);
                view.CheckChanged += CheckChanged;

                gridContent.Children.Add(view);
                DictView.Add(idol.Id, view);
            }

            refreshCount();
            refreshFilter("");
        }