CodeActivityContext.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 / CodeActivityContext.cs / 1305376 / CodeActivityContext.cs

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

namespace System.Activities 
{
    using System.Activities.Runtime; 
    using System.Activities.Tracking; 
    using System.Runtime;
 
    [Fx.Tag.XamlVisible(false)]
    public class CodeActivityContext : ActivityContext
    {
        // This is called by the Pool. 
        internal CodeActivityContext()
        { 
        } 

        // This is only used by base classes which do not take 
        // part in pooling.
        internal CodeActivityContext(ActivityInstance instance, ActivityExecutor executor)
            : base(instance, executor)
        { 
        }
 
        internal void Initialize(ActivityInstance instance, ActivityExecutor executor) 
        {
            base.Reinitialize(instance, executor); 
        }

        public THandle GetProperty() where THandle : Handle
        { 
            ThrowIfDisposed();
            if (this.CurrentInstance.PropertyManager != null) 
            { 
                return (THandle)this.CurrentInstance.PropertyManager.GetProperty(Handle.GetPropertyName(typeof(THandle)), this.Activity.MemberOf);
            } 
            else
            {
                return null;
            } 
        }
 
        public void Track(CustomTrackingRecord record) 
        {
            ThrowIfDisposed(); 

            if (record == null)
            {
                throw FxTrace.Exception.ArgumentNull("record"); 
            }
 
            base.TrackCore(record); 
        }
    } 
}

// 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