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


C# WorkItemInfo类代码示例

本文整理汇总了C#中WorkItemInfo的典型用法代码示例。如果您正苦于以下问题:C# WorkItemInfo类的具体用法?C# WorkItemInfo怎么用?C# WorkItemInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


WorkItemInfo类属于命名空间,在下文中一共展示了WorkItemInfo类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WorkItemInfo

 public WorkItemInfo(WorkItemInfo workItemInfo)
 {
     UseCallerCallContext = workItemInfo.UseCallerCallContext;
     UseCallerHttpContext = workItemInfo.UseCallerHttpContext;
     DisposeOfStateObjects = workItemInfo.DisposeOfStateObjects;
     CallToPostExecute = workItemInfo.CallToPostExecute;
     PostExecuteWorkItemCallback = workItemInfo.PostExecuteWorkItemCallback;
     WorkItemPriority = workItemInfo.WorkItemPriority;
 }
开发者ID:vls,项目名称:hp2p,代码行数:9,代码来源:WorkItemInfo.cs

示例2: 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

示例3: CreateWorkItem

 /// <summary>
 ///   Create a new work item
 /// </summary>
 /// <param name = "wigStartInfo">Work item group start information</param>
 /// <param name = "workItemInfo">Work item info</param>
 /// <param name = "callback">A callback to execute</param>
 /// <returns>Returns a work item</returns>
 public static WorkItem CreateWorkItem(
     IWorkItemsGroup workItemsGroup,
     WIGStartInfo wigStartInfo,
     WorkItemInfo workItemInfo,
     WorkItemCallback callback)
 {
     return CreateWorkItem(
         workItemsGroup,
         wigStartInfo,
         workItemInfo,
         callback,
         null);
 }
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:20,代码来源:WorkItemFactory.cs

示例4: QueueWorkItem

        /// <summary>
        /// 队列
        /// </summary>
        /// <param name="callBack"></param>
        /// <param name="userstate"></param>
        public ThreadEx QueueWorkItem(WaitCallback callBack, object userstate) {
            WorkItemInfo info = new WorkItemInfo();
            info.AutoResetEvent = new AutoResetEvent(false);
            handlerStack.Add(info.AutoResetEvent);
            info.WaitCallback = callBack;
            info.UserState = userstate;

            ThreadPool.QueueUserWorkItem((state) => {
                WorkItemInfo workItemInfo = (WorkItemInfo)state;
                try {
                    workItemInfo.WaitCallback(workItemInfo.UserState);
                } finally { workItemInfo.AutoResetEvent.Set(); }
            }, info);
            return this;
        }
开发者ID:pczy,项目名称:Pub.Class,代码行数:20,代码来源:ThreadPoolEx.cs

示例5: 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="state">
        /// The context object of the work item. Used for passing arguments to the work item. 
        /// </param>
        /// <returns>Returns a work item</returns>
        public static WorkItem CreateWorkItem(
            IWorkItemsGroup workItemsGroup,
            WIGStartInfo wigStartInfo,
            WorkItemCallback callback,
            object state)
        {
            ValidateCallback(callback);

            var workItemInfo = new WorkItemInfo();
            workItemInfo.UseCallerCallContext = wigStartInfo.UseCallerCallContext;
            workItemInfo.UseCallerHttpContext = wigStartInfo.UseCallerHttpContext;
            workItemInfo.PostExecuteWorkItemCallback = wigStartInfo.PostExecuteWorkItemCallback;
            workItemInfo.CallToPostExecute = wigStartInfo.CallToPostExecute;
            workItemInfo.DisposeOfStateObjects = wigStartInfo.DisposeOfStateObjects;

            var workItem = new WorkItem(
                workItemsGroup,
                workItemInfo,
                callback,
                state);
            return workItem;
        }
开发者ID:SQLServerIO,项目名称:TPCCBench,代码行数:31,代码来源:WorkItemFactory.cs

示例6: WorkItem

	    /// <summary>
	    /// Initialize the callback holding object.
	    /// </summary>
	    /// <param name="workItemsGroup"></param>
	    /// <param name="workItemInfo"></param>
	    /// <param name="callback">Callback delegate for the callback.</param>
	    /// <param name="state">State with which to call the callback delegate.</param>
	    /// 
	    /// We assume that the WorkItem object is created within the thread
	    /// that meant to run the callback
	    public WorkItem(
			IWorkItemsGroup workItemsGroup,
			WorkItemInfo workItemInfo,
			WorkItemCallback callback, 
			object state)
		{
			_workItemsGroup = workItemsGroup;
			_workItemInfo = workItemInfo;

			if (_workItemInfo.UseCallerCallContext || _workItemInfo.UseCallerHttpContext)
			{
				_callerContext = CallerThreadContext.Capture(_workItemInfo.UseCallerCallContext, _workItemInfo.UseCallerHttpContext);
			}

			_callback = callback;
			_state = state;
			_workItemResult = new WorkItemResult(this);
			Initialize();
		}
开发者ID:BookSwapSteve,项目名称:Exceptionless,代码行数:29,代码来源:WorkItem.cs

示例7: WorkItem

        /// <summary>
        /// Initialize the callback holding object.
        /// </summary>
        /// <param name="workItemsGroup">The workItemGroup of the workitem</param>
        /// <param name="workItemInfo">The WorkItemInfo of te workitem</param>
        /// <param name="callback">Callback delegate for the callback.</param>
        /// <param name="state">State with which to call the callback delegate.</param>
        /// 
        /// We assume that the WorkItem object is created within the thread
        /// that meant to run the callback
        public WorkItem(
            IWorkItemsGroup workItemsGroup,
            WorkItemInfo workItemInfo,
            WorkItemCallback callback,
            object state)
        {
            _workItemsGroup = workItemsGroup;
            _workItemInfo = workItemInfo;

#if !(_WINDOWS_CE) && !(_SILVERLIGHT) && !(WINDOWS_PHONE)
            if (_workItemInfo.UseCallerCallContext || _workItemInfo.UseCallerHttpContext)
            {
                _callerContext = CallerThreadContext.Capture(_workItemInfo.UseCallerCallContext, _workItemInfo.UseCallerHttpContext);
            }
#endif

            _callback = callback;
            _state = state;
            _workItemResult = new WorkItemResult(this);
            Initialize();
        }
开发者ID:CassieEllen,项目名称:opensim,代码行数:31,代码来源:WorkItem.cs

示例8: QueueWorkItem

 /// <summary>
 /// Queue a work item
 /// </summary>
 /// <param name="workItemInfo">Work item 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>
 /// <returns>Returns a work item result</returns>
 public IWorkItemResult QueueWorkItem(WorkItemInfo workItemInfo, WorkItemCallback callback, object state)
 {
     WorkItem workItem = WorkItemFactory.CreateWorkItem(this, _workItemsGroupStartInfo, workItemInfo, callback,
                                                        state);
     EnqueueToSTPNextWorkItem(workItem);
     return workItem.GetWorkItemResult();
 }
开发者ID:SQLServerIO,项目名称:TPCCBench,代码行数:16,代码来源:WorkItemsGroup.cs


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