Exemplo n.º 1
0
        /// <summary>
        /// 直接创建线程参数对象,不从配置构建
        /// </summary>
        /// <param name="name">线程名称</param>
        public ThreadParam(string name)
        {
            this.name        = name;
            this.description = name;

            //this.ActivateDuration = new TimeSpan(0, 0, 5);
            //this.DisposeDuration = new TimeSpan(0, 5, 0);

            this.log = new ServiceLog(name);

            this.exitEvent = new ManualResetEvent(false);
        }
		private static void WriteJobException(JobBase job, ServiceLog log, string op, Exception ex)
		{
			string message = string.Format("{0}作业\"{1}\"({2})错误: {3}", op, job.Name, job.JobID, ex.GetRealException().ToString());

			log.Write(message);
		}
		private void buttonConvert_Click(object sender, EventArgs e)
		{
			using (AD2DBInitialParams initParams = AD2DBInitialParams.GetParams())
			{
				textBoxLog.Text = string.Empty;

				ServiceLog log = new ServiceLog("ADToAccredit");

				log.AddTextBoxTraceListener(textBoxLog);

				initParams.Log = log;

				this._ProcessedObjectsCount = 0;

				OutputStatus();

				initParams.BeforeProcessADObject += new BeforeProcessADObjectDelegate(initParams_BeforeProcessADObject);

				AD2DBConvertion converter = new AD2DBConvertion(initParams);

				converter.DoConvert();

				OutputStatus();

				OguMechanismFactory.GetMechanism().RemoveAllCache();
				PermissionMechanismFactory.GetMechanism().RemoveAllCache();
			}
		}
Exemplo n.º 4
0
		/// <summary>
		/// 直接创建线程参数对象,不从配置构建
		/// </summary>
		/// <param name="name">线程名称</param>
		public ThreadParam(string name)
		{
			this.name = name;
			this.description = name;

			//this.ActivateDuration = new TimeSpan(0, 0, 5);
			//this.DisposeDuration = new TimeSpan(0, 5, 0);

			this.log = new ServiceLog(name);

			this.exitEvent = new ManualResetEvent(false);
		}