Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / clr / src / BCL / System / Text / SurrogateEncoder.cs / 1 / SurrogateEncoder.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
// WARNING:
//
// This is just an IObjectReference proxy for the former V1.1 Surrogate Encoder
// All this does is make an encoder of the correct type, it DOES NOT maintain state.
namespace System.Text
{
using System;
using System.Runtime.Serialization;
using System.Security.Permissions;
/*=================================SurrogateEncoder==================================
** This class is here only to deserialize the SurrogateEncoder class from Everett (V1.1) into
** Appropriate Whidbey (V2.0) objects.
==============================================================================*/
[Serializable()]
internal sealed class SurrogateEncoder : ISerializable, IObjectReference
{
// Might need this when GetRealObjecting
[NonSerialized]
private Encoding realEncoding = null;
// Constructor called by serialization.
internal SurrogateEncoder(SerializationInfo info, StreamingContext context)
{
// Any info?
if (info==null) throw new ArgumentNullException("info");
// All versions have a code page
this.realEncoding = (Encoding)info.GetValue("m_encoding", typeof(Encoding));
}
// Just get it from GetEncoding
public Object GetRealObject(StreamingContext context)
{
// Need to get our Encoding's Encoder
return this.realEncoding.GetEncoder();
}
// ISerializable implementation
[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.SerializationFormatter)]
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
// We cannot ever call this.
BCLDebug.Assert(false, "Didn't expect to make it to SurrogateEncoder.GetObjectData");
throw new ArgumentException(Environment.GetResourceString("Arg_ExecutionEngineException"));
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
// WARNING:
//
// This is just an IObjectReference proxy for the former V1.1 Surrogate Encoder
// All this does is make an encoder of the correct type, it DOES NOT maintain state.
namespace System.Text
{
using System;
using System.Runtime.Serialization;
using System.Security.Permissions;
/*=================================SurrogateEncoder==================================
** This class is here only to deserialize the SurrogateEncoder class from Everett (V1.1) into
** Appropriate Whidbey (V2.0) objects.
==============================================================================*/
[Serializable()]
internal sealed class SurrogateEncoder : ISerializable, IObjectReference
{
// Might need this when GetRealObjecting
[NonSerialized]
private Encoding realEncoding = null;
// Constructor called by serialization.
internal SurrogateEncoder(SerializationInfo info, StreamingContext context)
{
// Any info?
if (info==null) throw new ArgumentNullException("info");
// All versions have a code page
this.realEncoding = (Encoding)info.GetValue("m_encoding", typeof(Encoding));
}
// Just get it from GetEncoding
public Object GetRealObject(StreamingContext context)
{
// Need to get our Encoding's Encoder
return this.realEncoding.GetEncoder();
}
// ISerializable implementation
[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.SerializationFormatter)]
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
// We cannot ever call this.
BCLDebug.Assert(false, "Didn't expect to make it to SurrogateEncoder.GetObjectData");
throw new ArgumentException(Environment.GetResourceString("Arg_ExecutionEngineException"));
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BufferedStream.cs
- BookmarkScope.cs
- SourceFilter.cs
- ObjectPersistData.cs
- SuppressIldasmAttribute.cs
- CodeDOMProvider.cs
- GroupAggregateExpr.cs
- PerspectiveCamera.cs
- ReflectionServiceProvider.cs
- SubpageParagraph.cs
- AffineTransform3D.cs
- SignatureTargetIdManager.cs
- SqlConnectionHelper.cs
- XmlNamespaceMapping.cs
- MonitoringDescriptionAttribute.cs
- ValidatingReaderNodeData.cs
- SchemaCollectionPreprocessor.cs
- WmpBitmapDecoder.cs
- DBBindings.cs
- NamespaceInfo.cs
- KerberosSecurityTokenProvider.cs
- TypeSystemProvider.cs
- LoadWorkflowByKeyAsyncResult.cs
- WebSysDescriptionAttribute.cs
- Parser.cs
- WebServiceEnumData.cs
- StructuralObject.cs
- ConfigurationStrings.cs
- AlternateView.cs
- NegotiationTokenAuthenticator.cs
- Message.cs
- TimeoutException.cs
- AsyncOperation.cs
- LinkLabelLinkClickedEvent.cs
- ListDesigner.cs
- ArrayConverter.cs
- XmlSchemaCompilationSettings.cs
- DispatchWrapper.cs
- WebPartCatalogAddVerb.cs
- OleDbErrorCollection.cs
- ListControlDesigner.cs
- Int64AnimationBase.cs
- TripleDESCryptoServiceProvider.cs
- ClientBuildManager.cs
- Rotation3DAnimation.cs
- InkPresenter.cs
- SmtpDigestAuthenticationModule.cs
- RuntimeHelpers.cs
- CursorConverter.cs
- XPathAncestorIterator.cs
- SBCSCodePageEncoding.cs
- KeyValuePair.cs
- SizeChangedInfo.cs
- SqlInternalConnectionTds.cs
- Compiler.cs
- NetworkStream.cs
- listitem.cs
- WebConfigurationHost.cs
- IgnorePropertiesAttribute.cs
- NavigationCommands.cs
- ToolBarOverflowPanel.cs
- ThrowHelper.cs
- Brush.cs
- Configuration.cs
- CommandField.cs
- WebPartCloseVerb.cs
- BufferModeSettings.cs
- TextEffectCollection.cs
- ValidateNames.cs
- OpCodes.cs
- SBCSCodePageEncoding.cs
- DocumentEventArgs.cs
- ValueExpressions.cs
- Wildcard.cs
- RoleManagerSection.cs
- WindowsProgressbar.cs
- SmtpNetworkElement.cs
- AttributeEmitter.cs
- FlowDocumentPage.cs
- DesignerView.xaml.cs
- TemplateBindingExtensionConverter.cs
- DBDataPermission.cs
- PriorityBinding.cs
- ListSourceHelper.cs
- MailHeaderInfo.cs
- TextCollapsingProperties.cs
- Activity.cs
- IMembershipProvider.cs
- SmtpAuthenticationManager.cs
- TagPrefixCollection.cs
- RegexStringValidatorAttribute.cs
- DataControlField.cs
- OleDbRowUpdatingEvent.cs
- XmlIncludeAttribute.cs
- ServiceOperation.cs
- PublishLicense.cs
- PropertyInformation.cs
- SettingsProperty.cs
- RegexStringValidatorAttribute.cs
- XslTransform.cs