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


C# WorkItemPriority类代码示例

本文整理汇总了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);
 }
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:15,代码来源:WorkItemFactory.cs

示例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;
 }
开发者ID:taojunfeng,项目名称:ImageLib.UWP,代码行数:11,代码来源:LimitedConcurrencyLevelTaskScheduler.cs

示例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;
 }
开发者ID:3di,项目名称:3di-viewer-rei-libs,代码行数:11,代码来源:WIGStartInfo.cs

示例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;
 }
开发者ID:newchild,项目名称:Project-DayZero,代码行数:13,代码来源:WIGStartInfo.cs

示例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);
 }
开发者ID:newchild,项目名称:Project-DayZero,代码行数:15,代码来源:WorkItemFactory.cs

示例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;
 }
开发者ID:mlabs-pl,项目名称:stp,代码行数:11,代码来源:Form1.cs

示例7: RunAsync

		public static IAsyncAction RunAsync (WorkItemHandler handler, WorkItemPriority priority)
		{
			return RunAsync (handler);
		}
开发者ID:ermau,项目名称:WinRT.NET,代码行数:4,代码来源:ThreadPool.cs

示例8: PriorityItem

		    public PriorityItem(WorkItemPriority workItemPriority)
			{
				WorkItemPriority = workItemPriority;
			}
开发者ID:laoqiuChina,项目名称:SmartThreadPool,代码行数:4,代码来源:TestPriorityQueue.cs

示例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();
 }
开发者ID:SQLServerIO,项目名称:TPCCBench,代码行数:26,代码来源:WorkItemsGroup.cs

示例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;
		}
开发者ID:andyhebear,项目名称:SmartThreadPool,代码行数:36,代码来源:WorkItemFactory.cs

示例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);
            }
        }
开发者ID:MichelZ,项目名称:fanart.tv-API,代码行数:19,代码来源:FileDownloader.cs

示例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();
 }
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:14,代码来源:SmartThreadPool.cs

示例13: WorkItemInfo

 public WorkItemInfo(WorkItemInfo workItemInfo)
 {
     _useCallerCallContext = workItemInfo._useCallerCallContext;
     _useCallerHttpContext = workItemInfo._useCallerHttpContext;
     _disposeOfStateObjects = workItemInfo._disposeOfStateObjects;
     _callToPostExecute = workItemInfo._callToPostExecute;
     _postExecuteWorkItemCallback = workItemInfo._postExecuteWorkItemCallback;
     _workItemPriority = workItemInfo._workItemPriority;
 }
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:9,代码来源:WorkItemInfo.cs


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