Amib.Threading.Internal.WorkItem.Execute C# (CSharp) 메소드

Execute() 공개 메소드

Execute the work item and the post execute
public Execute ( ) : void
리턴 void
        public void Execute()
        {
            CallToPostExecute currentCallToPostExecute = 0;

            // Execute the work item if we are in the correct state
            switch (GetWorkItemState())
            {
                case WorkItemState.InProgress:
                    currentCallToPostExecute |= CallToPostExecute.WhenWorkItemNotCanceled;
                    ExecuteWorkItem();
                    break;
                case WorkItemState.Canceled:
                    currentCallToPostExecute |= CallToPostExecute.WhenWorkItemCanceled;
                    break;
                default:
                    Debug.Assert(false);
                    throw new NotSupportedException();
            }

            // Run the post execute as needed
            if ((currentCallToPostExecute & _workItemInfo.CallToPostExecute) != 0)
            {
                PostExecute();
            }

            _processingStopwatch.Stop();
        }

Usage Example

예제 #1
0
 // Token: 0x060017F3 RID: 6131
 // RVA: 0x000745E8 File Offset: 0x000727E8
 private void ExecuteWorkItem(WorkItem workItem_0)
 {
     this._windowsPCs.SampleWorkItemsWaitTime(workItem_0.WaitingTime);
     this._localPCs.SampleWorkItemsWaitTime(workItem_0.WaitingTime);
     try
     {
         workItem_0.Execute();
     }
     finally
     {
         this._windowsPCs.SampleWorkItemsProcessTime(workItem_0.ProcessTime);
         this._localPCs.SampleWorkItemsProcessTime(workItem_0.ProcessTime);
     }
 }
All Usage Examples Of Amib.Threading.Internal.WorkItem::Execute