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
- AvTrace.cs
- WebProxyScriptElement.cs
- cookie.cs
- NetPeerTcpBindingElement.cs
- IIS7WorkerRequest.cs
- PrintPreviewGraphics.cs
- InputScopeAttribute.cs
- TypeSystem.cs
- NewExpression.cs
- SafeCloseHandleCritical.cs
- VisualBrush.cs
- OptimisticConcurrencyException.cs
- SqlProviderManifest.cs
- FlagsAttribute.cs
- WebPartConnection.cs
- BindingExpression.cs
- XslCompiledTransform.cs
- TimeoutValidationAttribute.cs
- UIElementParagraph.cs
- CacheRequest.cs
- DateTimeOffset.cs
- ArgIterator.cs
- RtfControlWordInfo.cs
- DuplicateDetector.cs
- PeerInvitationResponse.cs
- Base64Stream.cs
- Size3D.cs
- MembershipPasswordException.cs
- SyntaxCheck.cs
- DBSqlParser.cs
- QilGenerator.cs
- SystemIPInterfaceProperties.cs
- DataGridViewComboBoxCell.cs
- SplashScreenNativeMethods.cs
- EditorAttribute.cs
- RegexMatchCollection.cs
- PassportAuthenticationModule.cs
- ObjectViewQueryResultData.cs
- Sql8ExpressionRewriter.cs
- FtpWebRequest.cs
- EntityViewGenerationAttribute.cs
- ComplexType.cs
- RegexCaptureCollection.cs
- Signature.cs
- RemoteWebConfigurationHost.cs
- Facet.cs
- ProfileServiceManager.cs
- PackWebResponse.cs
- XamlSerializerUtil.cs
- XamlRtfConverter.cs
- CatalogPart.cs
- SwitchExpression.cs
- RoleManagerModule.cs
- PeerNameRecord.cs
- WindowsAuthenticationModule.cs
- TimelineGroup.cs
- SqlVisitor.cs
- UpdatePanelControlTrigger.cs
- RequestedSignatureDialog.cs
- counter.cs
- PersonalizationProviderCollection.cs
- BasicExpandProvider.cs
- MemberExpressionHelper.cs
- SoapFaultCodes.cs
- PKCS1MaskGenerationMethod.cs
- QilInvoke.cs
- SecurityUniqueId.cs
- DelegateSerializationHolder.cs
- HostingPreferredMapPath.cs
- EllipseGeometry.cs
- NonClientArea.cs
- Invariant.cs
- ListViewTableCell.cs
- XmlChildEnumerator.cs
- CommandTreeTypeHelper.cs
- GetChildSubtree.cs
- SynchronizedDispatch.cs
- SerializationSectionGroup.cs
- MaterialGroup.cs
- StructuredTypeInfo.cs
- EventLogPermissionAttribute.cs
- ObjectConverter.cs
- SubclassTypeValidatorAttribute.cs
- EUCJPEncoding.cs
- TdsParserStaticMethods.cs
- TimelineGroup.cs
- TypeLibConverter.cs
- SmiRecordBuffer.cs
- HttpRequest.cs
- LabelDesigner.cs
- ItemCheckEvent.cs
- BidirectionalDictionary.cs
- WindowCollection.cs
- FontResourceCache.cs
- GenericEnumConverter.cs
- SmiRequestExecutor.cs
- IODescriptionAttribute.cs
- WmpBitmapEncoder.cs
- Repeater.cs
- _SingleItemRequestCache.cs