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
- CodeLinePragma.cs
- BitmapEffectInput.cs
- SerTrace.cs
- FrameDimension.cs
- SqlFlattener.cs
- CodeTypeDeclaration.cs
- DataServiceCollectionOfT.cs
- FixedSOMTable.cs
- ToolboxControl.cs
- IPAddress.cs
- Thickness.cs
- TextEditorCharacters.cs
- CodeDesigner.cs
- ParsedAttributeCollection.cs
- EventsTab.cs
- NativeMethods.cs
- CustomErrorsSectionWrapper.cs
- SerialErrors.cs
- ChineseLunisolarCalendar.cs
- SimpleType.cs
- NavigationService.cs
- AssemblyHash.cs
- DefaultValueConverter.cs
- CheckBox.cs
- ServicePointManager.cs
- DayRenderEvent.cs
- ClientBuildManagerCallback.cs
- PropertyTabChangedEvent.cs
- RegexReplacement.cs
- OleTxTransaction.cs
- PropertyInfoSet.cs
- Triangle.cs
- XmlExceptionHelper.cs
- VectorAnimation.cs
- GridViewDeleteEventArgs.cs
- LinkDescriptor.cs
- HttpFileCollection.cs
- CompilerInfo.cs
- DataControlFieldCell.cs
- DesignerImageAdapter.cs
- Viewport2DVisual3D.cs
- Pipe.cs
- ExtendLockCommand.cs
- ADMembershipUser.cs
- SHA384.cs
- ExtendedProtectionPolicyTypeConverter.cs
- SineEase.cs
- CharAnimationUsingKeyFrames.cs
- GlobalizationSection.cs
- System.Data_BID.cs
- HttpCapabilitiesSectionHandler.cs
- ApplicationServicesHostFactory.cs
- FileSystemEventArgs.cs
- ConstructorBuilder.cs
- SocketAddress.cs
- MsmqQueue.cs
- Sequence.cs
- DataColumnChangeEvent.cs
- CompoundFileStreamReference.cs
- ReadOnlyDictionary.cs
- Parameter.cs
- DataControlImageButton.cs
- DefaultShape.cs
- EntityWithChangeTrackerStrategy.cs
- TraceContextEventArgs.cs
- Set.cs
- PresentationAppDomainManager.cs
- ZoneLinkButton.cs
- SafeRegistryKey.cs
- NavigationWindowAutomationPeer.cs
- Stream.cs
- ExpressionBinding.cs
- ClipboardProcessor.cs
- ReferentialConstraint.cs
- GridViewUpdateEventArgs.cs
- RoutedEvent.cs
- InputLanguageEventArgs.cs
- ControlCollection.cs
- XmlWriterTraceListener.cs
- ToolStripDropDownClosingEventArgs.cs
- GridViewDeletedEventArgs.cs
- StaticContext.cs
- Mappings.cs
- StorageTypeMapping.cs
- ProgressBar.cs
- SoapFault.cs
- Facet.cs
- LicenseProviderAttribute.cs
- ActivityScheduledQuery.cs
- XmlSchemaException.cs
- WindowsPen.cs
- OleDbPropertySetGuid.cs
- Visual3D.cs
- NoClickablePointException.cs
- ViewRendering.cs
- ScriptReference.cs
- TextAnchor.cs
- _ListenerResponseStream.cs
- Attributes.cs
- ContentTextAutomationPeer.cs