Exemple #1
0
        /// <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="workItemPriority">The work item priority</param>
        /// <returns>Returns a work item result</returns>
        public new IWorkItemResult QueueWorkItem(WorkItemCallback callback, object state, WorkItemPriority workItemPriority)
        {
            WorkItem workItem = WorkItemFactory.CreateWorkItem(this, WIGStartInfo, callback, state, workItemPriority);

            Enqueue(workItem);
            return(workItem.GetWorkItemResult());
        }
Exemple #2
0
        /// <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)
        {
            this.ValidateNotDisposed();
            this.ValidateCallback(callback);
            WorkItem workItem = WorkItemFactory.CreateWorkItem(this, this._stpStartInfo, callback, state, postExecuteWorkItemCallback, callToPostExecute, workItemPriority);

            this.Enqueue(workItem);
            return(workItem.GetWorkItemResult());
        }
Exemple #3
0
        /// <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)
        {
            this.ValidateNotDisposed();
            this.ValidateCallback(callback);
            WorkItem workItem = WorkItemFactory.CreateWorkItem(this, this._stpStartInfo, workItemInfo, callback, state);

            this.Enqueue(workItem);
            return(workItem.GetWorkItemResult());
        }