Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- BackgroundFormatInfo.cs
- SchemaTypeEmitter.cs
- SessionPageStateSection.cs
- ProfileSection.cs
- DbConnectionPoolOptions.cs
- FileLogRecordStream.cs
- brushes.cs
- StylusPointPropertyId.cs
- TableCellAutomationPeer.cs
- ListViewInsertEventArgs.cs
- SmiGettersStream.cs
- UserPersonalizationStateInfo.cs
- MeasureData.cs
- Util.cs
- PathGeometry.cs
- ToolBarDesigner.cs
- BoolExpression.cs
- infer.cs
- TargetException.cs
- ProfilePropertySettings.cs
- CompleteWizardStep.cs
- ExpressionEditorAttribute.cs
- ApplyTemplatesAction.cs
- SecurityPolicySection.cs
- WebBrowserProgressChangedEventHandler.cs
- Schema.cs
- TreeNodeCollectionEditor.cs
- DataObjectSettingDataEventArgs.cs
- SubstitutionList.cs
- CloseCollectionAsyncResult.cs
- NavigationExpr.cs
- UidPropertyAttribute.cs
- MachineKeyConverter.cs
- DtdParser.cs
- DTCTransactionManager.cs
- AuthenticationModuleElementCollection.cs
- ClientSettingsSection.cs
- ResourceWriter.cs
- ObjectHandle.cs
- SafeNativeMethodsOther.cs
- SQLDoubleStorage.cs
- precedingsibling.cs
- EmbeddedObject.cs
- DefaultPrintController.cs
- DefaultBindingPropertyAttribute.cs
- QueryUtil.cs
- SmtpFailedRecipientException.cs
- InstallerTypeAttribute.cs
- SizeAnimationUsingKeyFrames.cs
- PropertyKey.cs
- XsltLibrary.cs
- RelationshipManager.cs
- NonDualMessageSecurityOverHttpElement.cs
- ChainedAsyncResult.cs
- ListItemCollection.cs
- ApplicationException.cs
- ToolBarOverflowPanel.cs
- DotExpr.cs
- EntityDataSourceUtil.cs
- RecommendedAsConfigurableAttribute.cs
- OciLobLocator.cs
- ErrorsHelper.cs
- _NegoState.cs
- Fonts.cs
- TransportChannelListener.cs
- ObjectResult.cs
- ScriptRegistrationManager.cs
- WindowHelperService.cs
- HttpDebugHandler.cs
- ReflectEventDescriptor.cs
- PeerEndPoint.cs
- MetadataStore.cs
- AmbientValueAttribute.cs
- ActionNotSupportedException.cs
- OletxResourceManager.cs
- ForwardPositionQuery.cs
- ProcessRequestArgs.cs
- ArgumentValueSerializer.cs
- MSG.cs
- DataSourceXmlTextReader.cs
- MethodAccessException.cs
- ExtensionsSection.cs
- ObfuscateAssemblyAttribute.cs
- serverconfig.cs
- WSTrustDec2005.cs
- TextCompositionEventArgs.cs
- NegationPusher.cs
- ToolStripMenuItem.cs
- TextEffectResolver.cs
- ProviderIncompatibleException.cs
- ParagraphResult.cs
- SynchronizedDisposablePool.cs
- DragAssistanceManager.cs
- CharKeyFrameCollection.cs
- URIFormatException.cs
- SamlDelegatingWriter.cs
- SqlReorderer.cs
- EnumerableRowCollectionExtensions.cs
- WindowsSpinner.cs
- PermissionSetTriple.cs