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
- WindowsStatusBar.cs
- Italic.cs
- DocumentGridPage.cs
- AuthenticationServiceManager.cs
- WebHttpSecurityElement.cs
- ContainerControlDesigner.cs
- OracleInternalConnection.cs
- BlurEffect.cs
- CaseInsensitiveOrdinalStringComparer.cs
- EventEntry.cs
- SharedStatics.cs
- nulltextcontainer.cs
- IndentedTextWriter.cs
- Html32TextWriter.cs
- RemotingSurrogateSelector.cs
- PenContexts.cs
- IIS7UserPrincipal.cs
- StructuralType.cs
- HTTPNotFoundHandler.cs
- FileVersion.cs
- EventPrivateKey.cs
- RelativeSource.cs
- HttpCookie.cs
- Size3D.cs
- ImageIndexConverter.cs
- SQLDoubleStorage.cs
- ping.cs
- WrapPanel.cs
- SearchForVirtualItemEventArgs.cs
- FlowDocumentFormatter.cs
- EdmProperty.cs
- DataControlFieldCollection.cs
- Duration.cs
- FactoryGenerator.cs
- StylusPointProperty.cs
- SerializationInfo.cs
- EntityConnectionStringBuilder.cs
- HttpCookieCollection.cs
- QilGeneratorEnv.cs
- EncryptedKey.cs
- EdmEntityTypeAttribute.cs
- MetadataException.cs
- NotConverter.cs
- Base64Encoder.cs
- ChainOfDependencies.cs
- ValueUnavailableException.cs
- EntityClientCacheEntry.cs
- Stackframe.cs
- UserControlBuildProvider.cs
- CoreSwitches.cs
- VectorCollectionValueSerializer.cs
- CustomErrorCollection.cs
- x509store.cs
- GridViewCommandEventArgs.cs
- Byte.cs
- EditingCommands.cs
- LogSwitch.cs
- ToolStripRendererSwitcher.cs
- FocusTracker.cs
- RowVisual.cs
- PeerApplicationLaunchInfo.cs
- CaseDesigner.xaml.cs
- DropSource.cs
- Grant.cs
- MemberAccessException.cs
- FlowPosition.cs
- Viewport3DVisual.cs
- GroupBoxAutomationPeer.cs
- MailWebEventProvider.cs
- ObjectSet.cs
- MethodBody.cs
- TraceInternal.cs
- XmlNamespaceDeclarationsAttribute.cs
- ListViewItemCollectionEditor.cs
- SerialReceived.cs
- PeerCustomResolverElement.cs
- SplitterPanel.cs
- DataContext.cs
- VirtualizedContainerService.cs
- BridgeDataReader.cs
- HttpCapabilitiesEvaluator.cs
- Literal.cs
- Convert.cs
- TraceAsyncResult.cs
- SplitterCancelEvent.cs
- CompositeFontParser.cs
- ResetableIterator.cs
- CollectionViewGroup.cs
- StylusButton.cs
- XmlSchemaExternal.cs
- UrlPath.cs
- HttpWebRequest.cs
- SmiMetaDataProperty.cs
- DateTimeConverter.cs
- NativeMethods.cs
- safex509handles.cs
- ResponseBodyWriter.cs
- Console.cs
- AnonymousIdentificationSection.cs
- EndpointInstanceProvider.cs