2019-03-20

private void EndUpdateNews()
        {
            using (TransactionScope scope = new TransactionScope())
            {
                try
                {
                    this._articleNewsCount += this.ParseTagSubNews();
                    base.BeginInvoke(this.noteInvoke, new object[] { string.Format("当前下载新闻 {3} 条,解析新闻 {0} 条,专题新闻 {1} 条,常规新闻 {2} 条。", new object[] { this._articleNewsCount + this._subNewsCount, this._subNewsCount, this._articleNewsCount, this._downloadCount }) });
                    scope.Complete();
                }
                catch (Exception exception)
                {
                    this._subDic.Clear();
                    base.BeginInvoke(this.logInvoke, new object[] { "专题新闻分类出现异常。" });
                    this.WriteException(exception);
                    base.BeginInvoke(this.logInvoke, new object[] { "数据库数据进行回滚" });
                    Transaction.Current.Rollback();
                }
                finally
                {
                    Application.DoEvents();
                    scope.Dispose();
                }
            }
            using (TransactionScope scope2 = new TransactionScope())
            {
                try
                {
                    this._subNewsCount += this.ParseTagArticleNews();
                    base.BeginInvoke(this.noteInvoke, new object[] { string.Format("当前下载新闻 {3} 条,解析新闻 {0} 条,专题新闻 {1} 条,常规新闻 {2} 条。", new object[] { this._articleNewsCount + this._subNewsCount, this._subNewsCount, this._articleNewsCount, this._downloadCount }) });
                    scope2.Complete();
                }
                catch (Exception exception2)
                {
                    this._articleDic.Clear();
                    base.BeginInvoke(this.logInvoke, new object[] { "常规新闻分类出现异常。" });
                    this.WriteException(exception2);
                    base.BeginInvoke(this.logInvoke, new object[] { "数据库数据进行回滚" });
                    Transaction.Current.Rollback();
                }
                finally
                {
                    Application.DoEvents();
                    scope2.Dispose();
                }
            }
            this.FinishCurrentWork();
        }
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容