public CategoryFilter(TorrentList TorrentList, HashSet <string> CategorySet)
        {
            torrentList = TorrentList;

            InitializeComponent();

            cmbCategory.Items.Add("Visas");
            bool filmasExist = CategorySet.Any(x => x.Contains("Filma"));

            if (filmasExist)
            {
                CategorySet.Add("Filma");
            }

            IEnumerable <string> chkListSorted = CategorySet.OrderBy(s => s);

            foreach (string cat in chkListSorted)
            {
                cmbCategory.Items.Add(cat);
            }
            Init();
        }
Beispiel #2
0
        private async void Init()
        {
            if (el.GetType() == typeof(WebBrowser))
            {
                WebBrowser web = el as WebBrowser;
                web.LoadCompleted += Web_LoadCompleted;
            }
            if (el.GetType() == typeof(TorrentList))
            {
                TorrentList tList = el as TorrentList;
                while (!tList.fanoCompleted || !tList.kinozalCompleted || !tList.filebaseCompleted)
                {
                    await Task.Delay(1000);
                }

                progressBar.Visibility = Visibility.Collapsed;

                CategoryFilter catFilter = new CategoryFilter(tList, tList.categorySet);
                filterPanel.Content = catFilter;
            }
            containerList.Children.Add(el);
        }