当前位置: 首页>>代码示例>>C#>>正文


C# Action.NullCheck方法代码示例

本文整理汇总了C#中System.Action.NullCheck方法的典型用法代码示例。如果您正苦于以下问题:C# Action.NullCheck方法的具体用法?C# Action.NullCheck怎么用?C# Action.NullCheck使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Action的用法示例。


在下文中一共展示了Action.NullCheck方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadUserTasksByActivity

		public UserTaskCollection LoadUserTasksByActivity(string activityID, Action<InSqlClauseBuilder> action)
		{
			action.NullCheck("action");

			InSqlClauseBuilder builder = new InSqlClauseBuilder();

			action(builder);

			string sql = string.Format("SELECT * FROM WF.USER_TASK WHERE ACTIVITY_ID = {0}",
				TSqlBuilder.Instance.CheckUnicodeQuotationMark(activityID));

			if (builder.Count > 0)
				sql += " AND " + builder.ToSqlStringWithInOperator(TSqlBuilder.Instance);

			UserTaskCollection result = new UserTaskCollection();

			DataTable table = DbHelper.RunSqlReturnDS(sql, GetConnectionName()).Tables[0];

			foreach (DataRow row in table.Rows)
			{
				UserTask task = new UserTask();

				ORMapping.DataRowToObject(row, task);

				result.Add(task);
			}

			return result;
		}
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:29,代码来源:UserTaskAdapter.cs

示例2: Load

        /// <summary>
        /// 
        /// </summary>
        /// <param name="fillAssignees"></param>
        /// <param name="action"></param>
        /// <returns></returns>
        public WfProcessCurrentInfoCollection Load(bool fillAssignees, Action<WhereSqlClauseBuilder> action)
        {
            action.NullCheck("action");

            WfProcessCurrentInfoCollection result = new WfProcessCurrentInfoCollection();

            WhereSqlClauseBuilder whereBuilder = new WhereSqlClauseBuilder();

            action(whereBuilder);

            string fieldNames = ORMapping.GetSelectFieldsNameSql<WfProcessInstanceData>("Data");

            string sql = string.Format("SELECT {0} FROM WF.PROCESS_INSTANCES WHERE {1}",
                    fieldNames,
                    whereBuilder.ToSqlString(TSqlBuilder.Instance));

            DataTable table = DbHelper.RunSqlReturnDS(sql, GetConnectionName()).Tables[0];

            result.LoadFromDataView(table.DefaultView);

            if (fillAssignees)
                FillAssignees(result);

            return result;
        }
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:31,代码来源:WfProcessCurrentInfoAdapter.cs

示例3: ExecutionWrapper

        /// <summary>
        /// 操作执行的包装类,在操作的开始和结束输出时间信息
        /// </summary>
        /// <param name="operationName"></param>
        /// <param name="action"></param>
        private static void ExecutionWrapper(string operationName, Action action)
        {
            operationName.CheckStringIsNullOrEmpty("operationName");
            action.NullCheck("action");

            WfExecutorLogContextInfo.Writer.WriteLine("\t\t{0}开始:{1:yyyy-MM-dd HH:mm:ss.fff}",
                    operationName, DateTime.Now);

            Stopwatch sw = new Stopwatch();

            sw.Start();
            try
            {
                action();
            }
            finally
            {
                sw.Stop();
                WfExecutorLogContextInfo.Writer.WriteLine("\t\t{0}结束:{1:yyyy-MM-dd HH:mm:ss.fff};经过时间:{2:#,##0}毫秒",
                    operationName, DateTime.Now, sw.ElapsedMilliseconds);
            }
        }
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:27,代码来源:WfExecutorBase.cs

示例4: ExecutionWrapper

		/// <summary>
		/// 执行操作,通过日志输出操作时间
		/// </summary>
		/// <param name="operationName"></param>
		/// <param name="action"></param>
		public void ExecutionWrapper(string operationName, Action action)
		{
			operationName.CheckStringIsNullOrEmpty("operationName");
			action.NullCheck("action");

			ProcessProgress.Current.Output.WriteLine("\t\t{0}开始:{1:yyyy-MM-dd HH:mm:ss.fff}",
					operationName, DateTime.Now);

			Stopwatch sw = new Stopwatch();

			sw.Start();
			try
			{
				action();
			}
			finally
			{
				sw.Stop();
				ProcessProgress.Current.Output.WriteLine("\t\t{0}结束:{1:yyyy-MM-dd HH:mm:ss.fff};经过时间:{2:#,##0}毫秒",
					operationName, DateTime.Now, sw.ElapsedMilliseconds);
			}
		}
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:27,代码来源:AUConditionCalculatingContext.cs

示例5: LoadUserTasks

		public UserTaskCollection LoadUserTasks(Action<WhereSqlClauseBuilder> action)
		{
			action.NullCheck("action");

			WhereSqlClauseBuilder builder = new WhereSqlClauseBuilder();

			action(builder);

			string sql = string.Format("SELECT * FROM WF.USER_TASK WHERE {0}", builder.ToSqlString(TSqlBuilder.Instance));

			UserTaskCollection result = new UserTaskCollection();

			DataTable table = DbHelper.RunSqlReturnDS(sql, GetConnectionName()).Tables[0];

			foreach (DataRow row in table.Rows)
			{
				UserTask task = new UserTask();

				ORMapping.DataRowToObject(row, task);

				result.Add(task);
			}

			return result;
		}
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:25,代码来源:UserTaskAdapter.cs

示例6: LoadProcesses

        private WfProcessCollection LoadProcesses(Action<WhereSqlClauseBuilder> action)
        {
            action.NullCheck("action");

            var whereBuilder = new WhereSqlClauseBuilder();

            action(whereBuilder);

            var mapping = ORMapping.GetMappingInfo<WfProcessInstanceData>();

            string[] fields = ORMapping.GetSelectFieldsName(mapping, "Data");

            var sql = string.Format("SELECT {0},{1} FROM {2} WHERE {3}",
                string.Join(",", fields),
                BINARYDATA,
                mapping.TableName,
                whereBuilder.ToSqlString(TSqlBuilder.Instance));

            var table = DbHelper.RunSqlReturnDS(sql, GetConnectionName()).Tables[0];

            WfProcessCollection result = null;

            PerformanceMonitorHelper.GetDefaultMonitor().WriteExecutionDuration("DataTableToProcessCollection",
                () => result = DataTableToProcessCollection(table)
            );

            return result;
        }
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:28,代码来源:WfSqlProcessPersistManager.cs

示例7: DeleteProcesses

        private void DeleteProcesses(Action<WhereSqlClauseBuilder> action)
        {
            action.NullCheck("action");

            ORMappingItemCollection mapping = ORMapping.GetMappingInfo<WfProcessInstanceData>();

            WhereSqlClauseBuilder whereBuilder = new WhereSqlClauseBuilder();

            action(whereBuilder);

            string sql = string.Format("DELETE {0} WHERE {1}", mapping.TableName, whereBuilder.ToSqlString(TSqlBuilder.Instance));
            WfProcessCurrentInfoCollection processesInfo = WfProcessCurrentInfoAdapter.Instance.Load(false, action);

            Dictionary<object, object> context = new Dictionary<object, object>();

            using (TransactionScope scope = TransactionScopeFactory.Create())
            {
                DbHelper.RunSql(sql, GetConnectionName());

                WfProcessCurrentActivityAdapter.Instance.DeleteProcessActivities(processesInfo);
                WfRelativeProcessAdapter.Instance.Delete(processesInfo);

                WfExtraPersistenceSettings.GetConfig().GetPersisters().DeleteData(processesInfo, context);

                scope.Complete();
            }
        }
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:27,代码来源:WfSqlProcessPersistManager.cs

示例8: Delete

        /// <summary>
        /// 删除EmailMessage
        /// </summary>
        /// <param name="action"></param>
        public void Delete(Action<WhereSqlClauseBuilder> action)
        {
            action.NullCheck("action");

            WhereSqlClauseBuilder builder = new WhereSqlClauseBuilder();

            action(builder);
            builder.AppendTenantCode();

            StringBuilder strB = new StringBuilder();

            using (StringWriter writer = new StringWriter(strB))
            {
                WriteDeleteEmailAddressesSql(writer, builder);
                WriteDeleteEmailAttachmentsSql(writer, builder);
                writer.WriteLine("DELETE MSG.EMAIL_MESSAGES WHERE {0}",
                    builder.ToSqlString(TSqlBuilder.Instance));
            }

            DbHelper.RunSqlWithTransaction(strB.ToString(), GetConnectionName());
        }
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:25,代码来源:EmailMessageAdapter.cs

示例9: ExecuteProcessAction

        private static WfClientProcessInfo ExecuteProcessAction(string processID, WfClientRuntimeContext runtimeContext, Action<IWfProcess> action)
        {
            processID.CheckStringIsNullOrEmpty("processID");
            action.NullCheck("action");

            IWfProcess process = GetProcessByProcessID(processID, runtimeContext);

            MeregeRuntimeContext(process, runtimeContext);

            DoPrincipalAction(runtimeContext, () => action(process));

            return process.ToClientProcessInfo(runtimeContext.Operator);
        }
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:13,代码来源:ProcessRuntimeService.svc.cs


注:本文中的System.Action.NullCheck方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。