本文整理汇总了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]();
}
}
示例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;
}
示例3: TimeScheduler
private TimeScheduler(string name, Action action)
{
name.NotNullOrEmpty("name");
action.NotNull("action");
this._name = name;
this._action = action;
this._timer = BuildTimer();
}
示例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);
}
}
示例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]();
}
});
}
示例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;
}
示例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;
}
}
}