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


C# Action.NotNull方法代码示例

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


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

示例1: Execute

        public virtual void Execute(IList<Action> ops, Action<IEnumerable<Action>> remainingOps)
        {
            for (var i = 0; i < ops.Count; i++)
            {
                if (!AcceptingJobs)
                {
                    remainingOps.NotNull(obj => remainingOps(ops.Skip(i + 1)));
                    break;
                }

                ops[i]();
            }
        }
开发者ID:helios-io,项目名称:helios,代码行数:13,代码来源:BasicExecutor.cs

示例2: Worker

        /// <summary>Initialize a new Worker for the specified method to run.
        /// </summary>
        public Worker(Action processor, Action successCallback, Action<Exception> exceptionCallback)
            : this(successCallback, exceptionCallback)
        {
            processor.NotNull("processor");

            this.Processor = processor;
        }
开发者ID:imyounghan,项目名称:thinklib,代码行数:9,代码来源:Worker.cs

示例3: TimeScheduler

        private TimeScheduler(string name, Action action)
        {
            name.NotNullOrEmpty("name");
            action.NotNull("action");

            this._name = name;
            this._action = action;
            this._timer = BuildTimer();
        }
开发者ID:imyounghan,项目名称:thinklib,代码行数:9,代码来源:TimeScheduler.cs

示例4: Execute

        public override void Execute(IList<Action> ops, Action<IEnumerable<Action>> remainingOps)
        {
            var i = 0;
            try
            {
                for (; i < ops.Count; i++)
                {
                    if (!AcceptingJobs)
                    {
// ReSharper disable once AccessToModifiedClosure
                        remainingOps.NotNull(obj => remainingOps(ops.Skip(i + 1)));
                        break;
                    }

                    ops[i]();
                }
            }
            catch (Exception ex)
            {
                remainingOps.NotNull(obj => remainingOps(ops.Skip(i + 1)));
                _exceptionCallback(ex);
            }
        }
开发者ID:KeithLee208,项目名称:helios,代码行数:23,代码来源:TryCatchExecutor.cs

示例5: ExecuteAsync

        public Task ExecuteAsync(IList<Action> ops, Action<IEnumerable<Action>> remainingOps)
        {
            return TaskRunner.Run(() =>
            {
                for (var i = 0; i < ops.Count; i++)
                {
                    if (!AcceptingJobs)
                    {
                        remainingOps.NotNull(obj => remainingOps(ops.Skip(i + 1)));
                        break;
                    }

                    ops[i]();
                }
            });
        }
开发者ID:helios-io,项目名称:helios,代码行数:16,代码来源:BasicExecutor.cs

示例6: SetAssignPrincipalFactory

        /// <summary>
        /// Sets the assign principal factory
        /// </summary>
        /// <remarks>USE THIS ONLY UNIT TESTING</remarks>
        /// <param name="assignPrincipalFactory">The factory</param>
        internal void SetAssignPrincipalFactory(
            Action<HttpRequestMessage, IPrincipal> assignPrincipalFactory)
        {
            assignPrincipalFactory.NotNull(nameof(assignPrincipalFactory));

            _assignPrincipalFactory = assignPrincipalFactory;
        }
开发者ID:c4rm4x,项目名称:C4rm4x.WebApi,代码行数:12,代码来源:AclBasedSecurityMessageHandler.cs

示例7: Initialize

        public static void Initialize(Action<Dictionary<string, string>> initializer)
        {
            //TODO:Read the configs(web.config,app.config) to global variables dictinary.

            if (!hasInit)
            {
                globalVariables = new Dictionary<string, string>();

                if (initializer.NotNull())
                {
                    initializer(globalVariables);

                    hasInit = true;
                }
            }

        }
开发者ID:Cloud33,项目名称:K2.Tasks-Service,代码行数:17,代码来源:ServiceContext.cs


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