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
- BypassElement.cs
- OutputCacheModule.cs
- NumberSubstitution.cs
- FormsAuthenticationUser.cs
- ValidatorCompatibilityHelper.cs
- SafeThemeHandle.cs
- StorageBasedPackageProperties.cs
- HScrollProperties.cs
- WebPartZoneBase.cs
- BitmapSource.cs
- Walker.cs
- ErrorTableItemStyle.cs
- InteropBitmapSource.cs
- SiteMapSection.cs
- SslStream.cs
- CatalogZoneBase.cs
- StatusBar.cs
- StylusCollection.cs
- ServiceX509SecurityTokenProvider.cs
- TcpWorkerProcess.cs
- StreamHelper.cs
- ProcessDesigner.cs
- SmtpFailedRecipientsException.cs
- EncryptedPackageFilter.cs
- AuthorizationSection.cs
- SynchronizationLockException.cs
- TypeEnumerableViewSchema.cs
- ToolStripRenderEventArgs.cs
- Util.cs
- TextServicesContext.cs
- DesignerWebPartChrome.cs
- ImportException.cs
- WebEvents.cs
- CaseStatement.cs
- PolicyChain.cs
- InfocardExtendedInformationEntry.cs
- DesignerLabelAdapter.cs
- HandlerBase.cs
- XmlReflectionMember.cs
- GestureRecognitionResult.cs
- ObjectViewEntityCollectionData.cs
- UserControl.cs
- UndoManager.cs
- AsymmetricSecurityProtocol.cs
- SynchronizationContext.cs
- ThreadInterruptedException.cs
- ExpandSegment.cs
- ViewManager.cs
- HtmlButton.cs
- ScriptResourceInfo.cs
- IndexedGlyphRun.cs
- EncryptedType.cs
- FatalException.cs
- DWriteFactory.cs
- XmlnsDictionary.cs
- PlanCompiler.cs
- SafeFileMapViewHandle.cs
- MarshalDirectiveException.cs
- PointLight.cs
- ValueSerializer.cs
- WebAdminConfigurationHelper.cs
- PropertyGrid.cs
- HelpInfo.cs
- StyleCollection.cs
- HasCopySemanticsAttribute.cs
- SamlAssertion.cs
- EDesignUtil.cs
- Clock.cs
- WebPartHelpVerb.cs
- OLEDB_Enum.cs
- TypefaceMap.cs
- AnonymousIdentificationSection.cs
- SpellCheck.cs
- TextRangeEdit.cs
- SpAudioStreamWrapper.cs
- CustomLineCap.cs
- HiddenFieldPageStatePersister.cs
- InternalCache.cs
- PictureBox.cs
- ConfigXmlCDataSection.cs
- PropertyBuilder.cs
- WebPartHelpVerb.cs
- ComponentResourceManager.cs
- Privilege.cs
- StorageMappingItemCollection.cs
- WebSysDescriptionAttribute.cs
- ToolStripScrollButton.cs
- Color.cs
- ColumnWidthChangedEvent.cs
- StyleBamlRecordReader.cs
- CompiledXpathExpr.cs
- HtmlElement.cs
- DriveNotFoundException.cs
- SafeNativeMethods.cs
- ObjectQuery_EntitySqlExtensions.cs
- Directory.cs
- Handle.cs
- UnsafeNativeMethods.cs
- DetailsViewUpdatedEventArgs.cs
- ColorIndependentAnimationStorage.cs