Xamarin Public Jenkins (auto-signing) e79aa3c0ed Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
2016-08-03 10:59:49 +00:00

55 lines
1.5 KiB
C#

#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;
}
}
}
}