本文整理汇总了C#中System.Action.Call方法的典型用法代码示例。如果您正苦于以下问题:C# Action.Call方法的具体用法?C# Action.Call怎么用?C# Action.Call使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Action
的用法示例。
在下文中一共展示了Action.Call方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
internal virtual void Run(Action pre, Action post)
{
pre.Call();
if (Kean.Error.Log.CatchErrors)
try
{
this.Method.Call();
}
catch (Exception)
{
Console.Write("F");
}
else
this.Method.Call();
post.Call();
}
示例2: Start
public static RepeatThread Start(string name, Action task, Action<RepeatThread, Action> run)
{
RepeatThread result = new RepeatThread();
Action wrappedTask = Error.Log.Wrap(string.Format("Thread \"{0}\" Failed.", name), () =>
{
try
{
task.Call();
}
catch (System.Threading.ThreadInterruptedException) { result.End = true; }
catch (System.Threading.ThreadAbortException) { result.End = true; }
});
run(result, () =>
{
result.Running = true;
while (!result.End)
wrappedTask();
result.Running = false;
});
return result;
}
示例3: Add
public void Add(char shortIdentifier, string longIdentifier, Action<string, string, string, string> handler)
{
this.Add(shortIdentifier, longIdentifier, 4, s => handler.Call(s[0], s[1], s[2], s[3]));
}
示例4: Resolve
public bool Resolve(Uri.Locator locator, Action<object> set)
{
bool result;
object target = this.targets[locator];
if (result = target.NotNull())
set.Call(target);
else
{
Action<object> looseEnd = this.looseEnds[locator];
if (looseEnd.NotNull())
looseEnd += set;
else
this.looseEnds[locator] = set;
}
return result;
}