ActivityExecutorSurrogate.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Common / AuthoringOM / Serializer / ActivityExecutorSurrogate.cs / 1305376 / ActivityExecutorSurrogate.cs

                            namespace System.Workflow.ComponentModel.Serialization 
{
 	using System;
	using System.IO;
	using System.Reflection; 
	using System.Collections;
 	using System.Runtime.Serialization; 
	using System.Runtime.Serialization.Formatters.Binary; 

 	internal sealed class ActivityExecutorSurrogate : ISerializationSurrogate 
 	{
		public ActivityExecutorSurrogate()
 		{
		} 
		public void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
		{ 
 			info.AddValue("executorType", obj.GetType()); 
			info.SetType(typeof(ActivityExecutorRef));
 		} 
 		public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
		{
 			return null;
		} 

		[Serializable] 
		private sealed class ActivityExecutorRef : IObjectReference 
 		{
			private Type	executorType	= null; 
 			Object IObjectReference.GetRealObject(StreamingContext context)
 			{
				return ActivityExecutors.GetActivityExecutorFromType(this.executorType);
 			} 
		}
	} 
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
namespace System.Workflow.ComponentModel.Serialization 
{
 	using System;
	using System.IO;
	using System.Reflection; 
	using System.Collections;
 	using System.Runtime.Serialization; 
	using System.Runtime.Serialization.Formatters.Binary; 

 	internal sealed class ActivityExecutorSurrogate : ISerializationSurrogate 
 	{
		public ActivityExecutorSurrogate()
 		{
		} 
		public void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
		{ 
 			info.AddValue("executorType", obj.GetType()); 
			info.SetType(typeof(ActivityExecutorRef));
 		} 
 		public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
		{
 			return null;
		} 

		[Serializable] 
		private sealed class ActivityExecutorRef : IObjectReference 
 		{
			private Type	executorType	= null; 
 			Object IObjectReference.GetRealObject(StreamingContext context)
 			{
				return ActivityExecutors.GetActivityExecutorFromType(this.executorType);
 			} 
		}
	} 
} 

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