Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- AspCompat.cs
- ProxyBuilder.cs
- SqlConnectionFactory.cs
- WindowsRichEditRange.cs
- UrlMappingsModule.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- SizeF.cs
- Viewport3DVisual.cs
- DeploymentExceptionMapper.cs
- GetPageCompletedEventArgs.cs
- MachineKeySection.cs
- MetadataArtifactLoaderFile.cs
- CheckPair.cs
- SchemaImporter.cs
- ValidationEventArgs.cs
- CharConverter.cs
- DragDropManager.cs
- DocComment.cs
- PrefixQName.cs
- Rectangle.cs
- Processor.cs
- WebServiceAttribute.cs
- Exceptions.cs
- SynchronizedChannelCollection.cs
- WebPartDisplayModeEventArgs.cs
- Size3DValueSerializer.cs
- XmlSerializerVersionAttribute.cs
- DeviceSpecificDialogCachedState.cs
- WhitespaceSignificantCollectionAttribute.cs
- HandleValueEditor.cs
- SoapFault.cs
- LicenseException.cs
- PropertyInfoSet.cs
- AddInAdapter.cs
- DocumentReference.cs
- PictureBox.cs
- SmtpNetworkElement.cs
- KeyValuePair.cs
- Helper.cs
- LocalizationParserHooks.cs
- CodeChecksumPragma.cs
- figurelength.cs
- FieldDescriptor.cs
- NamedPipeHostedTransportConfiguration.cs
- WindowInteractionStateTracker.cs
- WebConfigurationManager.cs
- BinarySecretKeyIdentifierClause.cs
- TextLineBreak.cs
- AttributeQuery.cs
- ContextActivityUtils.cs
- ToolboxBitmapAttribute.cs
- ComPlusAuthorization.cs
- DrawingContext.cs
- ChineseLunisolarCalendar.cs
- MetadataUtilsSmi.cs
- ExtendedProperty.cs
- EditorServiceContext.cs
- URL.cs
- QilInvoke.cs
- SqlRowUpdatedEvent.cs
- AutomationPeer.cs
- _SslStream.cs
- TextBox.cs
- Converter.cs
- NativeActivityTransactionContext.cs
- ExtensionWindowResizeGrip.cs
- TextSchema.cs
- MarkedHighlightComponent.cs
- StringResourceManager.cs
- DatatypeImplementation.cs
- GlobalProxySelection.cs
- IPipelineRuntime.cs
- ThemeableAttribute.cs
- Gdiplus.cs
- EntityViewGenerationConstants.cs
- WindowsFormsHostAutomationPeer.cs
- TraceUtility.cs
- CorePropertiesFilter.cs
- RedirectionProxy.cs
- ThemeInfoAttribute.cs
- EntityContainerEmitter.cs
- GenericTextProperties.cs
- DocComment.cs
- Int32AnimationBase.cs
- EffectiveValueEntry.cs
- Inline.cs
- RegularExpressionValidator.cs
- _HTTPDateParse.cs
- FrameworkObject.cs
- securitymgrsite.cs
- XmlHierarchicalDataSourceView.cs
- CorrelationTokenTypeConvertor.cs
- UpdateEventArgs.cs
- ObjectItemNoOpAssemblyLoader.cs
- TypeReference.cs
- Query.cs
- xml.cs
- DependencyObjectType.cs
- MailDefinition.cs
- WindowsGraphics.cs