//获得演员,信息照片都获取 public async void GetActorList() { CurrentActorPage = 1; TextType = "演员"; cdb = new DataBase(); List <Actress> models = null; await Task.Run(() => { models = cdb.SelectActorByVedioType(VedioType); }); await Task.Run(() => { cdb.CloseDB(); if (ActorList != null && models != null && models.Count == ActorList.ToList().Count) { return; } ActorList = new ObservableCollection <Actress>(); models?.ForEach(arg => { App.Current.Dispatcher.Invoke((Action) delegate { ActorList.Add(arg); }); }); TotalActorPage = (int)Math.Ceiling((double)ActorList.Count / (double)Properties.Settings.Default.ActorDisplayNum); ActorFlipOver(); }); }
//获得演员,信息照片都获取 public void GetActorList() { TextType = "演员"; Statistic(); stopwatch.Restart(); List <Actress> Actresses = DataBase.SelectAllActorName(VedioType); stopwatch.Stop(); Console.WriteLine($"\n加载演员用时:{stopwatch.ElapsedMilliseconds} ms"); if (ActorList != null && Actresses != null && Actresses.Count == ActorList.ToList().Count) { return; } ActorList = new ObservableCollection <Actress>(); ActorList.AddRange(Actresses); ActorFlipOver(); }