Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Text / SurrogateEncoder.cs / 1305376 / 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; using System.Diagnostics.Contracts; /*=================================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"); Contract.EndContractBlock(); // All versions have a code page this.realEncoding = (Encoding)info.GetValue("m_encoding", typeof(Encoding)); } // Just get it from GetEncoding [System.Security.SecurityCritical] // auto-generated public Object GetRealObject(StreamingContext context) { // Need to get our Encoding's Encoder return this.realEncoding.GetEncoder(); } #if FEATURE_SERIALIZATION // ISerializable implementation [System.Security.SecurityCritical] // auto-generated_required void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { // We cannot ever call this. Contract.Assert(false, "Didn't expect to make it to SurrogateEncoder.GetObjectData"); throw new ArgumentException(Environment.GetResourceString("Arg_ExecutionEngineException")); } #endif } } // 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; using System.Diagnostics.Contracts; /*=================================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"); Contract.EndContractBlock(); // All versions have a code page this.realEncoding = (Encoding)info.GetValue("m_encoding", typeof(Encoding)); } // Just get it from GetEncoding [System.Security.SecurityCritical] // auto-generated public Object GetRealObject(StreamingContext context) { // Need to get our Encoding's Encoder return this.realEncoding.GetEncoder(); } #if FEATURE_SERIALIZATION // ISerializable implementation [System.Security.SecurityCritical] // auto-generated_required void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { // We cannot ever call this. Contract.Assert(false, "Didn't expect to make it to SurrogateEncoder.GetObjectData"); throw new ArgumentException(Environment.GetResourceString("Arg_ExecutionEngineException")); } #endif } } // 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
- HttpListenerException.cs
- EntityDataSourceValidationException.cs
- TextParaClient.cs
- TreeViewImageKeyConverter.cs
- SystemColorTracker.cs
- DetailsViewRowCollection.cs
- ModuleBuilderData.cs
- Int32AnimationBase.cs
- DTCTransactionManager.cs
- QuadraticBezierSegment.cs
- RegisteredDisposeScript.cs
- autovalidator.cs
- RequestQueue.cs
- DesignerDataParameter.cs
- DataQuery.cs
- TreeSet.cs
- BufferedWebEventProvider.cs
- WebPageTraceListener.cs
- BadImageFormatException.cs
- FormViewUpdateEventArgs.cs
- ToolStripContextMenu.cs
- XmlSerializerNamespaces.cs
- ExtendLockCommand.cs
- AncestorChangedEventArgs.cs
- COSERVERINFO.cs
- BezierSegment.cs
- configsystem.cs
- FontWeightConverter.cs
- UIElementHelper.cs
- SimpleType.cs
- RepeatBehaviorConverter.cs
- DataSourceProvider.cs
- TwoPhaseCommit.cs
- KeyedCollection.cs
- Content.cs
- SchemaTableOptionalColumn.cs
- EncryptedType.cs
- InputScope.cs
- MethodInfo.cs
- DBNull.cs
- Effect.cs
- ValidatedControlConverter.cs
- X509Extension.cs
- HtmlInputPassword.cs
- UrlMappingsModule.cs
- CodeGeneratorOptions.cs
- SqlClientPermission.cs
- AssemblyHash.cs
- MimeParameters.cs
- SubstitutionList.cs
- WaitHandle.cs
- PocoEntityKeyStrategy.cs
- EmptyTextWriter.cs
- TypeDescriptionProviderAttribute.cs
- Application.cs
- ContentIterators.cs
- DataGridRow.cs
- XmlSchemaComplexContent.cs
- LeafCellTreeNode.cs
- SamlSubjectStatement.cs
- ClientConfigurationHost.cs
- _BasicClient.cs
- LocatorPartList.cs
- ProtocolInformationWriter.cs
- RadioButton.cs
- FixedSOMPageElement.cs
- CryptoApi.cs
- NamespaceQuery.cs
- DebugTrace.cs
- TcpConnectionPoolSettingsElement.cs
- AdornerDecorator.cs
- SystemColorTracker.cs
- UrlMappingsModule.cs
- ToolStripManager.cs
- DbCommandTree.cs
- PingReply.cs
- XamlSerializer.cs
- Identity.cs
- DesignBindingValueUIHandler.cs
- ReflectTypeDescriptionProvider.cs
- FilteredAttributeCollection.cs
- CachingParameterInspector.cs
- DependencyObjectCodeDomSerializer.cs
- NativeMethods.cs
- ServiceContractGenerator.cs
- FrameworkElement.cs
- RTLAwareMessageBox.cs
- ConsumerConnectionPointCollection.cs
- DataGridItemCollection.cs
- GACMembershipCondition.cs
- RootContext.cs
- OciHandle.cs
- DependencyObject.cs
- LogWriteRestartAreaAsyncResult.cs
- MediaPlayerState.cs
- SoapTypeAttribute.cs
- IImplicitResourceProvider.cs
- MessageSmuggler.cs
- SharedHttpsTransportManager.cs
- EventTask.cs