ActivityInstanceReference.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / Runtime / ActivityInstanceReference.cs / 1305376 / ActivityInstanceReference.cs

                            //------------------------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------------------------

namespace System.Activities.Runtime 
{
    using System; 
    using System.Runtime; 
    using System.Runtime.Serialization;
    using System.Collections.ObjectModel; 

    [DataContract]
    class ActivityInstanceReference : ActivityInstanceMap.IActivityReference
    { 
        [DataMember]
        ActivityInstance activityInstance; 
 
        internal ActivityInstanceReference(ActivityInstance activity)
        { 
            this.activityInstance = activity;
        }

        Activity ActivityInstanceMap.IActivityReference.Activity 
        {
            get 
            { 
                return this.activityInstance.Activity;
            } 
        }


        public ActivityInstance ActivityInstance 
        {
            get 
            { 
                return this.activityInstance;
            } 
        }

        void ActivityInstanceMap.IActivityReference.Load(Activity activity, ActivityInstanceMap instanceMap)
        { 
            // The conditional calling of ActivityInstance.Load is the value
            // added by this wrapper class.  This is because we can't guarantee 
            // that multiple activities won't have a reference to the same 
            // ActivityInstance.
            if (this.activityInstance.Activity == null) 
            {
                ((ActivityInstanceMap.IActivityReference)this.activityInstance).Load(activity, instanceMap);
            }
        } 
    }
} 
 


// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

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