本文整理汇总了C#中IWorkItemResult.GetResult方法的典型用法代码示例。如果您正苦于以下问题:C# IWorkItemResult.GetResult方法的具体用法?C# IWorkItemResult.GetResult怎么用?C# IWorkItemResult.GetResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWorkItemResult
的用法示例。
在下文中一共展示了IWorkItemResult.GetResult方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnProcessIncomingDatagramCompleted
private void OnProcessIncomingDatagramCompleted(IWorkItemResult result)
{
Exception e;
result.GetResult(out e);
if (e != null) UnhandledException(this, new ExceptionEventArgs(){ Exception = e});
}
示例2: PostIrrWorkItemHandler
private void PostIrrWorkItemHandler(IWorkItemResult wir)
{
if (wir.IsCanceled)
{
return;
}
object result = wir.GetResult();
if (result != null && irrWorkItems != null)
{
IrrWorkItem item = (IrrWorkItem)result;
lock (irrWorkItems)
{
irrWorkItems.Add(item);
}
}
}
示例3: PostExecuteWorkItemCallback
/// <summary>
/// Fires after each task is complete.
/// </summary>
/// <param name="wir">The work item results</param>
private void PostExecuteWorkItemCallback(IWorkItemResult wir)
{
var possibleState = wir.GetResult();
var information = possibleState as StateInformation;
if (information != null) //if not null, this is a work group
{
var state = information;
DeincrementCounter();
DeincrementGroup(state.Group);
_groups[state.Group].MetricCounter.Decrement(1);
_taskCounter.Decrement(_groups[state.Group].Group.Name, 1);
SetWaitHandle(state.Group);
}
else //is null, so this is not a work group item
{
DeincrementCounter();
_taskCounter.Decrement(1);
SetWaitHandle(null);
}
}
示例4: PostIrrWorkItemHandler
private void PostIrrWorkItemHandler(IWorkItemResult wir)
{
object result = wir.GetResult();
if (result != null)
{
IrrWorkItem item = (IrrWorkItem)result;
lock (irrWorkItems)
{
irrWorkItems.Add(item);
}
}
}