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
- FontInfo.cs
- DataServiceEntityAttribute.cs
- UIPermission.cs
- NativeDirectoryServicesQueryAPIs.cs
- VectorValueSerializer.cs
- WriteableBitmap.cs
- ConfigPathUtility.cs
- StringUtil.cs
- RealProxy.cs
- Oci.cs
- ViewManager.cs
- CompoundFileDeflateTransform.cs
- PassportAuthenticationEventArgs.cs
- WebUtility.cs
- EmbossBitmapEffect.cs
- OleAutBinder.cs
- DragCompletedEventArgs.cs
- AncestorChangedEventArgs.cs
- LifetimeServices.cs
- InternalConfigRoot.cs
- BrowserDefinition.cs
- SettingsPropertyValue.cs
- Geometry.cs
- DependencyPropertyValueSerializer.cs
- BaseProcessor.cs
- AutomationEventArgs.cs
- VBIdentifierDesigner.xaml.cs
- FormViewPagerRow.cs
- AttributeCollection.cs
- MsmqBindingMonitor.cs
- _UriTypeConverter.cs
- SessionState.cs
- FollowerQueueCreator.cs
- IdleTimeoutMonitor.cs
- SplitterDesigner.cs
- RowCache.cs
- TextPattern.cs
- Rotation3D.cs
- ActivityBuilderXamlWriter.cs
- ApplicationServiceManager.cs
- TcpPortSharing.cs
- PropertyEmitterBase.cs
- ExpressionsCollectionConverter.cs
- Config.cs
- DataGridLinkButton.cs
- DbDataSourceEnumerator.cs
- DbMetaDataColumnNames.cs
- COSERVERINFO.cs
- XmlDataDocument.cs
- SystemColors.cs
- ContextTokenTypeConverter.cs
- Point.cs
- RawKeyboardInputReport.cs
- JpegBitmapEncoder.cs
- XmlSchemaAttributeGroupRef.cs
- BooleanExpr.cs
- PasswordRecovery.cs
- CqlIdentifiers.cs
- GridViewColumnCollection.cs
- Size3DConverter.cs
- ConsumerConnectionPoint.cs
- ProbeRequestResponseAsyncResult.cs
- basevalidator.cs
- BamlLocalizableResourceKey.cs
- OletxVolatileEnlistment.cs
- XPathNodePointer.cs
- DataMemberConverter.cs
- UnsafeNativeMethods.cs
- ReadWriteObjectLock.cs
- ValidationSummary.cs
- ResumeStoryboard.cs
- SpellCheck.cs
- DynamicControlParameter.cs
- SafeTimerHandle.cs
- CollectionViewSource.cs
- ResourcePool.cs
- DataGridViewSelectedColumnCollection.cs
- _ProxyRegBlob.cs
- LinkLabelLinkClickedEvent.cs
- LineSegment.cs
- DockingAttribute.cs
- webproxy.cs
- GridViewDeletedEventArgs.cs
- TemplateBindingExpression.cs
- XmlCharType.cs
- GraphicsPath.cs
- DocumentViewer.cs
- MenuItemCollection.cs
- XmlLanguageConverter.cs
- InvalidOperationException.cs
- sqlstateclientmanager.cs
- Set.cs
- HtmlTableRowCollection.cs
- XmlSchemaAttribute.cs
- ViewStateException.cs
- HtmlTableRowCollection.cs
- HttpBufferlessInputStream.cs
- UIElementCollection.cs
- CodeIterationStatement.cs
- FileUtil.cs