WorkflowInstanceRecord.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 / WorkflowInstanceRecord.cs / 1305376 / WorkflowInstanceRecord.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 class WorkflowInstanceRecord : TrackingRecord 
    {
 
        public WorkflowInstanceRecord(Guid instanceId, string activityDefinitionId, string state) 
            : base(instanceId)
        { 
            if (string.IsNullOrEmpty(activityDefinitionId))
            {
                throw FxTrace.Exception.ArgumentNullOrEmpty("activityDefinitionId");
            } 
            if (string.IsNullOrEmpty(state))
            { 
                throw FxTrace.Exception.ArgumentNullOrEmpty("state"); 
            }
            this.ActivityDefinitionId = activityDefinitionId; 
            this.State = state;
        }

        public WorkflowInstanceRecord(Guid instanceId, long recordNumber, string activityDefinitionId, string state) 
            : base(instanceId, recordNumber)
        { 
            if (string.IsNullOrEmpty(activityDefinitionId)) 
            {
                throw FxTrace.Exception.ArgumentNullOrEmpty("activityDefinitionId"); 
            }
            if (string.IsNullOrEmpty(state))
            {
                throw FxTrace.Exception.ArgumentNullOrEmpty("state"); 
            }
            this.ActivityDefinitionId = activityDefinitionId; 
            this.State = state; 
        }
 
        protected WorkflowInstanceRecord(WorkflowInstanceRecord record)
            : base(record)
        {
            this.ActivityDefinitionId = record.ActivityDefinitionId; 
            this.State = record.State;
        } 
 

        [DataMember] 
        public string State
        {
            get;
            private set; 
        }
 
        [DataMember] 
        public string ActivityDefinitionId
        { 
            get;
            private set;
        }
 
        protected internal override TrackingRecord Clone()
        { 
            return new WorkflowInstanceRecord(this); 
        }
 
        public override string ToString()
        {
            return string.Format(CultureInfo.CurrentCulture,
                "WorkflowInstanceRecord {{ {0}, ActivityDefinitionId = {1}, State = {2} }}", 
                base.ToString(),
                this.ActivityDefinitionId, 
                this.State); 
        }
 
    }
}

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