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
- ImageClickEventArgs.cs
- ReflectPropertyDescriptor.cs
- LicenseContext.cs
- RemotingException.cs
- ContentOperations.cs
- ToolStripPanelRow.cs
- XmlEncodedRawTextWriter.cs
- TransformationRules.cs
- SqlMultiplexer.cs
- ReflectTypeDescriptionProvider.cs
- EntityDataSourceDesignerHelper.cs
- ServiceOperationParameter.cs
- TableLayoutCellPaintEventArgs.cs
- SiteMapNodeItem.cs
- Int16.cs
- CollectionExtensions.cs
- CoTaskMemHandle.cs
- RightsManagementInformation.cs
- TimeStampChecker.cs
- PropertyOverridesDialog.cs
- Version.cs
- ErrorWrapper.cs
- QueueProcessor.cs
- HttpGetClientProtocol.cs
- Repeater.cs
- ListItem.cs
- LongValidator.cs
- Error.cs
- BasicHttpBindingCollectionElement.cs
- FieldTemplateFactory.cs
- WebPartMovingEventArgs.cs
- TakeQueryOptionExpression.cs
- RelOps.cs
- MatrixTransform.cs
- StringUtil.cs
- odbcmetadatafactory.cs
- CapabilitiesRule.cs
- IDictionary.cs
- odbcmetadatafactory.cs
- HtmlElementCollection.cs
- ColorComboBox.cs
- UnsafeNativeMethods.cs
- ClientFormsAuthenticationMembershipProvider.cs
- UserUseLicenseDictionaryLoader.cs
- IPEndPoint.cs
- XsltLibrary.cs
- Pair.cs
- EdmValidator.cs
- HttpCachePolicyWrapper.cs
- AssemblyCache.cs
- Queue.cs
- ServicesExceptionNotHandledEventArgs.cs
- SubclassTypeValidator.cs
- MetadataAssemblyHelper.cs
- SettingsBindableAttribute.cs
- FieldBuilder.cs
- MachineKeySection.cs
- MergablePropertyAttribute.cs
- TrustManagerMoreInformation.cs
- Filter.cs
- SafeNativeMethods.cs
- ParenExpr.cs
- DataSourceHelper.cs
- ErrorEventArgs.cs
- GenericRootAutomationPeer.cs
- CodeIndexerExpression.cs
- SamlAuthorizationDecisionClaimResource.cs
- CodeTypeParameter.cs
- MenuScrollingVisibilityConverter.cs
- Interlocked.cs
- Console.cs
- MetaData.cs
- Point.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- SchemaContext.cs
- shaper.cs
- AuthorizationSection.cs
- URLMembershipCondition.cs
- DataGridHyperlinkColumn.cs
- XmlSchemaAnnotated.cs
- IsolatedStorageException.cs
- XslException.cs
- SelectionRangeConverter.cs
- Trace.cs
- BindingBase.cs
- ScriptModule.cs
- ControlEvent.cs
- PolyQuadraticBezierSegment.cs
- EntityDataSourceChangingEventArgs.cs
- ReflectionTypeLoadException.cs
- OleAutBinder.cs
- PropertyRecord.cs
- StorageTypeMapping.cs
- RowsCopiedEventArgs.cs
- TimeManager.cs
- RSACryptoServiceProvider.cs
- BooleanAnimationUsingKeyFrames.cs
- ShaderEffect.cs
- MetadataPropertyCollection.cs
- DbMetaDataFactory.cs