LogicalCallContext.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 / WF / Activities / LocalService / LogicalCallContext.cs / 1305376 / LogicalCallContext.cs

                            #region Using directives 

using System;
using System.Collections.Generic;
using System.Text; 
using System.Runtime.Remoting.Messaging;
using System.Runtime.Serialization; 
using System.Security; 
using System.Security.Permissions;
using System.Security.Principal; 
#endregion

namespace System.Workflow.Activities
{ 
    [Serializable]
    internal sealed class IdentityContextData : ILogicalThreadAffinative, ISerializable 
    { 
        internal const string IdentityContext = "__identitycontext__";
 
        String identity;

        internal IdentityContextData(String identity)
        { 
            this.identity = identity;
        } 
 
        private IdentityContextData(SerializationInfo info, StreamingContext context)
        { 
            SerializationInfoEnumerator enumerator = info.GetEnumerator();
            while (enumerator.MoveNext())
            {
                if (enumerator.Name.Equals("identity")) 
                {
                    this.identity = (String)enumerator.Value; 
                } 
            }
        } 

        [SecurityPermission( SecurityAction.Demand, SerializationFormatter = true)]
        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
        { 
            if (this.identity != null)
                info.AddValue("identity", identity.ToString()); 
        } 

        internal String Identity 
        {
            get
            {
                return identity; 
            }
        } 
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

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