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

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

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

    [Fx.Tag.XamlVisible(false)]
    [DataContract]
    public sealed class BookmarkResumptionRecord : TrackingRecord 
    {
        internal BookmarkResumptionRecord(Guid instanceId, Bookmark bookmark, ActivityInstance ownerInstance, object payload) 
            : base(instanceId) 
        {
            if (bookmark.Scope != null) 
            {
                this.BookmarkScope = bookmark.Scope.Id;
            }
 
            if (bookmark.IsNamed)
            { 
                this.BookmarkName = bookmark.Name; 
            }
 
            this.Owner = new ActivityInfo(ownerInstance);
            this.Payload = payload;
        }
 
        public BookmarkResumptionRecord(Guid instanceId, long recordNumber, Guid bookmarkScope, string bookmarkName, ActivityInfo owner)
            : base(instanceId, recordNumber) 
        { 
            if (owner == null)
            { 
                throw FxTrace.Exception.ArgumentNull("owner");
            }

            this.BookmarkScope = bookmarkScope; 
            this.BookmarkName = bookmarkName;
            this.Owner = owner; 
        } 

        BookmarkResumptionRecord(BookmarkResumptionRecord record) 
            : base(record)
        {
            this.BookmarkScope = record.BookmarkScope;
            this.Owner = record.Owner; 
            this.BookmarkName = record.BookmarkName;
            this.Payload = record.Payload; 
        } 

        [DataMember(EmitDefaultValue = false)] 
        public Guid BookmarkScope
        {
            get;
            private set; 
        }
 
        [DataMember(EmitDefaultValue = false)] 
        public string BookmarkName
        { 
            get;
            private set;
        }
 
        [DataMember]
        public object Payload 
        { 
            get;
            internal set; 
        }

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

        public override string ToString() 
        { 
            return string.Format(CultureInfo.CurrentCulture,
                "BookmarkResumptionRecord {{ {0}, BookmarkName = {1}, BookmarkScope = {2}, OwnerActivity {{ {3} }} }}", 
                base.ToString(),
                this.BookmarkName ?? "",
                this.BookmarkScope,
                this.Owner.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