public void ControlURLRewriteArticle() { this.CurrentCount = 0; Model.Local.ArticleRepository ArticleRepository = new Model.Local.ArticleRepository(); List <Int32> ListArticles = ArticleRepository.ListId(); this.ListCount = ListArticles.Count; Context = SynchronizationContext.Current; this.ParallelOptions.MaxDegreeOfParallelism = System.Environment.ProcessorCount; this.ReportProgressArticle(0); Task.Factory.StartNew(() => { Parallel.ForEach(ListArticles, this.ParallelOptions, ExecArticle); }); }
public GestionStatutArticle(List <Int32> ListArticle = null) { this.InitializeComponent(); if (ListArticle == null) { Model.Local.ArticleRepository ArticleRepository = new Model.Local.ArticleRepository(); ListArticle = ArticleRepository.ListId(); } this.ListCount = ListArticle.Count; Context = SynchronizationContext.Current; this.ParallelOptions.MaxDegreeOfParallelism = MaximumThreadCount; this.ReportProgress(0); Task.Factory.StartNew(() => { Parallel.ForEach(ListArticle, this.ParallelOptions, Sync); }); }
public SuppressionImage(Boolean DeleteOnlyIfSourceNotExist) { this.InitializeComponent(); DeleteOnlyNotSource = DeleteOnlyIfSourceNotExist; Model.Local.ArticleRepository ArticleRepository = new Model.Local.ArticleRepository(); List <int> ListArticle = ArticleRepository.ListId(); this.ListCount = ListArticle.Count; this.Context = SynchronizationContext.Current; this.ParallelOptions.MaxDegreeOfParallelism = MaximumThreadCount; this.ReportProgress(0); Task.Factory.StartNew(() => { Parallel.ForEach(ListArticle, this.ParallelOptions, Exec); }); }