WorkflowInstanceAbortedRecord.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 / WorkflowInstanceAbortedRecord.cs / 1305376 / WorkflowInstanceAbortedRecord.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 WorkflowInstanceAbortedRecord : WorkflowInstanceRecord 
    {
        public WorkflowInstanceAbortedRecord(Guid instanceId, string activityDefinitionId, string reason) 
            : base(instanceId, activityDefinitionId, WorkflowInstanceStates.Aborted) 
        {
            if (string.IsNullOrEmpty(reason)) 
            {
                throw FxTrace.Exception.ArgumentNullOrEmpty("reason");
            }
            this.Reason = reason; 
        }
 
        public WorkflowInstanceAbortedRecord(Guid instanceId, long recordNumber, string activityDefinitionId, string reason) 
            : base(instanceId, recordNumber, activityDefinitionId, WorkflowInstanceStates.Aborted)
        { 
            if (string.IsNullOrEmpty(reason))
            {
                throw FxTrace.Exception.ArgumentNullOrEmpty("reason");
            } 

            this.Reason = reason; 
        } 

        WorkflowInstanceAbortedRecord(WorkflowInstanceAbortedRecord record) 
            : base(record)
        {
            this.Reason = record.Reason;
        } 

        [DataMember] 
        public string Reason 
        {
            get; 
            private set;
        }

        protected internal override TrackingRecord Clone() 
        {
            return new WorkflowInstanceAbortedRecord(this); 
        } 

        public override string ToString() 
        {
            return string.Format(CultureInfo.CurrentCulture,
                "WorkflowInstanceAbortedRecord {{ InstanceId = {0}, RecordNumber = {1}, EventTime = {2}, ActivityDefinitionId = {3}, Reason = {4} }} ",
                this.InstanceId, 
                this.RecordNumber,
                this.EventTime, 
                this.ActivityDefinitionId, 
                this.Reason);
        } 
    }


} 

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