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

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

namespace System.Activities.Tracking 
{
    using System; 
    using System.Runtime.Serialization; 
    using System.Runtime;
    using System.Globalization; 

    [Fx.Tag.XamlVisible(false)]
    [DataContract]
    public sealed class ActivityScheduledRecord : TrackingRecord 
    {
        internal ActivityScheduledRecord(Guid instanceId, ActivityInstance instance, ActivityInstance child) 
            : base(instanceId) 
        {
            Fx.Assert(child != null, "Child activity cannot be null."); 
            if (instance != null)
            {
                this.Activity = new ActivityInfo(instance);
            } 
            this.Child = new ActivityInfo(child);
        } 
 
        //parameter activity is null if the root activity is being scheduled.
        public ActivityScheduledRecord( 
            Guid instanceId,
            long recordNumber,
            ActivityInfo activity,
            ActivityInfo child) 
            : base(instanceId, recordNumber)
        { 
            if (child == null) 
            {
                throw FxTrace.Exception.ArgumentNull("child"); 
            }

            this.Activity = activity;
            this.Child = child; 
        }
 
        ActivityScheduledRecord(ActivityScheduledRecord record) 
            : base(record)
        { 
            this.Activity = record.Activity;
            this.Child = record.Child;
        }
 
        [DataMember]
        public ActivityInfo Activity 
        { 
            get;
            private set; 
        }

        [DataMember]
        public ActivityInfo Child 
        {
            get; 
            private set; 
        }
 
        protected internal override TrackingRecord Clone()
        {
            return new ActivityScheduledRecord(this);
        } 

        public override string ToString() 
        { 
            return string.Format(CultureInfo.CurrentCulture,
               "ActivityScheduledRecord {{ {0}, Activity {{ {1} }}, ChildActivity {{ {2} }} }}", 
               base.ToString(),
               this.Activity == null ? "" : this.Activity.ToString(),
               this.Child.ToString());
        } 

    } 
} 

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