本文整理汇总了C#中WorkItemPriority类的典型用法代码示例。如果您正苦于以下问题:C# WorkItemPriority类的具体用法?C# WorkItemPriority怎么用?C# WorkItemPriority使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WorkItemPriority类属于命名空间,在下文中一共展示了WorkItemPriority类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateWorkItem
/// <summary>
/// Create a new work item
/// </summary>
/// <param name = "wigStartInfo">Work item group start information</param>
/// <param name = "callback">A callback to execute</param>
/// <param name = "workItemPriority">The priority of the work item</param>
/// <returns>Returns a work item</returns>
public static WorkItem CreateWorkItem(
IWorkItemsGroup workItemsGroup,
WIGStartInfo wigStartInfo,
WorkItemCallback callback,
WorkItemPriority workItemPriority)
{
return CreateWorkItem(workItemsGroup, wigStartInfo, callback, null, workItemPriority);
}
示例2: LimitedConcurrencyLevelTaskScheduler
// Creates a new instance with the specified degree of parallelism.
public LimitedConcurrencyLevelTaskScheduler(int maxDegreeOfParallelism, WorkItemPriority priority, bool fDisableInlining = false)
{
if (maxDegreeOfParallelism < 1)
{
throw new ArgumentOutOfRangeException("maxDegreeOfParallelism");
}
this._maxDegreeOfParallelism = maxDegreeOfParallelism;
this._workItemPriority = priority;
this._fDisableInlining = fDisableInlining;
}
示例3: WIGStartInfo
public WIGStartInfo(WIGStartInfo wigStartInfo)
{
_useCallerCallContext = wigStartInfo.UseCallerCallContext;
_useCallerHttpContext = wigStartInfo.UseCallerHttpContext;
_disposeOfStateObjects = wigStartInfo.DisposeOfStateObjects;
_callToPostExecute = wigStartInfo.CallToPostExecute;
_postExecuteWorkItemCallback = wigStartInfo.PostExecuteWorkItemCallback;
_workItemPriority = wigStartInfo.WorkItemPriority;
_startSuspended = wigStartInfo.StartSuspended;
_fillStateWithArgs = wigStartInfo.FillStateWithArgs;
}
示例4: WIGStartInfo
// Token: 0x06001837 RID: 6199
// RVA: 0x00074E5C File Offset: 0x0007305C
public WIGStartInfo(WIGStartInfo wigstartInfo_0)
{
this._useCallerCallContext = wigstartInfo_0.UseCallerCallContext;
this._useCallerHttpContext = wigstartInfo_0.UseCallerHttpContext;
this._disposeOfStateObjects = wigstartInfo_0.DisposeOfStateObjects;
this._callToPostExecute = wigstartInfo_0.CallToPostExecute;
this._postExecuteWorkItemCallback = wigstartInfo_0.PostExecuteWorkItemCallback;
this._workItemPriority = wigstartInfo_0.WorkItemPriority;
this._startSuspended = wigstartInfo_0.StartSuspended;
this._fillStateWithArgs = wigstartInfo_0.FillStateWithArgs;
}
示例5: CreateWorkItem
// Token: 0x0600185F RID: 6239
// RVA: 0x00075274 File Offset: 0x00073474
public static WorkItem CreateWorkItem(IWorkItemsGroup iworkItemsGroup_0, WIGStartInfo wigstartInfo_0, WorkItemCallback workItemCallback_0, object object_0, WorkItemPriority workItemPriority_0)
{
WorkItemFactory.ValidateCallback(workItemCallback_0);
return new WorkItem(iworkItemsGroup_0, new WorkItemInfo
{
UseCallerCallContext = wigstartInfo_0.UseCallerCallContext,
UseCallerHttpContext = wigstartInfo_0.UseCallerHttpContext,
PostExecuteWorkItemCallback = wigstartInfo_0.PostExecuteWorkItemCallback,
CallToPostExecute = wigstartInfo_0.CallToPostExecute,
DisposeOfStateObjects = wigstartInfo_0.DisposeOfStateObjects,
WorkItemPriority = workItemPriority_0
}, workItemCallback_0, object_0);
}
示例6: EnqueueWorkItems
private void EnqueueWorkItems(ref int startIndex, int count, string text, Color color, WorkItemPriority priority, IWorkItemsGroup wig, int sleepDuration)
{
for (int i = 0; i < count; ++i, ++startIndex)
{
wig.QueueWorkItem(
DoNothing,
new WorkItemState(new QueueUsageControl.QueueUsageEntry(string.Format("{0}{1} ({2})", text, startIndex, priority.ToString().Substring(0,2 )), color), sleepDuration),
priority);
}
_workItemsGenerated += count;
}
示例7: RunAsync
public static IAsyncAction RunAsync (WorkItemHandler handler, WorkItemPriority priority)
{
return RunAsync (handler);
}
示例8: PriorityItem
public PriorityItem(WorkItemPriority workItemPriority)
{
WorkItemPriority = workItemPriority;
}
示例9: QueueWorkItem
/// <summary>
/// Queue a work item
/// </summary>
/// <param name="callback">A callback to execute</param>
/// <param name="state">
/// The context object of the work item. Used for passing arguments to the work item.
/// </param>
/// <param name="postExecuteWorkItemCallback">
/// A delegate to call after the callback completion
/// </param>
/// <param name="callToPostExecute">Indicates on which cases to call to the post execute callback</param>
/// <param name="workItemPriority">The work item priority</param>
/// <returns>Returns a work item result</returns>
public IWorkItemResult QueueWorkItem(
WorkItemCallback callback,
object state,
PostExecuteWorkItemCallback postExecuteWorkItemCallback,
CallToPostExecute callToPostExecute,
WorkItemPriority workItemPriority)
{
WorkItem workItem = WorkItemFactory.CreateWorkItem(this, _workItemsGroupStartInfo, callback, state,
postExecuteWorkItemCallback, callToPostExecute,
workItemPriority);
EnqueueToSTPNextWorkItem(workItem);
return workItem.GetWorkItemResult();
}
示例10: CreateWorkItem
/// <summary>
/// Create a new work item
/// </summary>
/// <param name="workItemsGroup">The work items group</param>
/// <param name="wigStartInfo">Work item group start information</param>
/// <param name="callback">A callback to execute</param>
/// <param name="state">
/// The context object of the work item. Used for passing arguments to the work item.
/// </param>
/// <param name="workItemPriority">The work item priority</param>
/// <returns>Returns a work item</returns>
public static WorkItem CreateWorkItem(
IWorkItemsGroup workItemsGroup,
WIGStartInfo wigStartInfo,
WorkItemCallback callback,
object state,
WorkItemPriority workItemPriority)
{
ValidateCallback(callback);
WorkItemInfo workItemInfo = new WorkItemInfo();
workItemInfo.UseCallerCallContext = wigStartInfo.UseCallerCallContext;
workItemInfo.UseCallerHttpContext = wigStartInfo.UseCallerHttpContext;
workItemInfo.PostExecuteWorkItemCallback = wigStartInfo.PostExecuteWorkItemCallback;
workItemInfo.CallToPostExecute = wigStartInfo.CallToPostExecute;
workItemInfo.DisposeOfStateObjects = wigStartInfo.DisposeOfStateObjects;
workItemInfo.WorkItemPriority = workItemPriority;
WorkItem workItem = new WorkItem(
workItemsGroup,
workItemInfo,
callback,
state);
return workItem;
}
示例11: AddDownload
/// <summary>
/// Add a file to download to the queue
/// You have to subscribe to the <see cref="DownloadProgressNotification"/> event to get notified when the download is finished.
/// </summary>
/// <param name="uri">File to download</param>
/// <param name="localFile">Local path to download to</param>
/// <param name="identifier">Arbitrary identifier</param>
/// <param name="overwriteExistingFile">Overwrite an already existing file</param>
/// <param name="retries">Number of times to retry the download until we fail</param>
/// <param name="priority">Priority for the WorkItem</param>
public void AddDownload(Uri uri, FileInfo localFile, object identifier, bool overwriteExistingFile, int retries, WorkItemPriority priority)
{
var fileDownloadInfo = new FileDownloadInfo{ Url = uri, Identifier = identifier, LocalFile = localFile, Priority = priority, Retries = retries, OverwriteExistingFile = overwriteExistingFile };
lock (downloadThreadPoolLockObject)
{
downloadThreadPool.QueueWorkItem(this.DoWork, fileDownloadInfo, priority);
}
}
示例12: QueueWorkItem
/// <summary>
/// Queue a work item
/// </summary>
/// <param name="callback">A callback to execute</param>
/// <param name="workItemPriority">The priority of the work item</param>
/// <returns>Returns a work item result</returns>
public IWorkItemResult QueueWorkItem(WorkItemCallback callback, WorkItemPriority workItemPriority)
{
ValidateNotDisposed();
ValidateCallback(callback);
WorkItem workItem = WorkItemFactory.CreateWorkItem(this, _stpStartInfo, callback, workItemPriority);
Enqueue(workItem);
return workItem.GetWorkItemResult();
}
示例13: WorkItemInfo
public WorkItemInfo(WorkItemInfo workItemInfo)
{
_useCallerCallContext = workItemInfo._useCallerCallContext;
_useCallerHttpContext = workItemInfo._useCallerHttpContext;
_disposeOfStateObjects = workItemInfo._disposeOfStateObjects;
_callToPostExecute = workItemInfo._callToPostExecute;
_postExecuteWorkItemCallback = workItemInfo._postExecuteWorkItemCallback;
_workItemPriority = workItemInfo._workItemPriority;
}