WorkflowEnvironment.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / RunTime / WorkflowEnvironment.cs / 1305376 / WorkflowEnvironment.cs

                            #pragma warning disable 1634, 1691 
using System;
using System.Collections;
using System.Workflow.ComponentModel;
using System.Workflow.Runtime; 
using System.Diagnostics;
using System.Transactions; 
 
namespace System.Workflow.Runtime
{ 
    public static class WorkflowEnvironment /*: IDisposable*/
    {
        public static IWorkBatch WorkBatch
        { 
            get
            { 
                IWorkBatch currentBatch = ServiceEnvironment.WorkBatch; 

#pragma warning disable 56503 
                if (currentBatch == null)
                    throw new System.InvalidOperationException(ExecutionStringManager.WorkBatchNotFound);
#pragma warning restore 56503
 
                return currentBatch;
            } 
        } 

        public static Guid WorkflowInstanceId 
        {
            get
            {
#pragma warning disable 56503 
                Guid currentInstanceId = ServiceEnvironment.WorkflowInstanceId;
 
                if (currentInstanceId == Guid.Empty) 
                    throw new System.InvalidOperationException(ExecutionStringManager.InstanceIDNotFound);
#pragma warning restore 56503 

                return currentInstanceId;
            }
        } 
    }
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
#pragma warning disable 1634, 1691 
using System;
using System.Collections;
using System.Workflow.ComponentModel;
using System.Workflow.Runtime; 
using System.Diagnostics;
using System.Transactions; 
 
namespace System.Workflow.Runtime
{ 
    public static class WorkflowEnvironment /*: IDisposable*/
    {
        public static IWorkBatch WorkBatch
        { 
            get
            { 
                IWorkBatch currentBatch = ServiceEnvironment.WorkBatch; 

#pragma warning disable 56503 
                if (currentBatch == null)
                    throw new System.InvalidOperationException(ExecutionStringManager.WorkBatchNotFound);
#pragma warning restore 56503
 
                return currentBatch;
            } 
        } 

        public static Guid WorkflowInstanceId 
        {
            get
            {
#pragma warning disable 56503 
                Guid currentInstanceId = ServiceEnvironment.WorkflowInstanceId;
 
                if (currentInstanceId == Guid.Empty) 
                    throw new System.InvalidOperationException(ExecutionStringManager.InstanceIDNotFound);
#pragma warning restore 56503 

                return currentInstanceId;
            }
        } 
    }
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK