コード例 #1
0
        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);
            });
        }
コード例 #2
0
        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);
            });
        }
コード例 #3
0
        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);
            });
        }