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
- EmptyReadOnlyDictionaryInternal.cs
- ChangePasswordDesigner.cs
- EventProxy.cs
- DataListItemCollection.cs
- TypeSystemProvider.cs
- TextParaLineResult.cs
- CommentGlyph.cs
- WrapperEqualityComparer.cs
- BufferedGraphicsManager.cs
- ListViewCommandEventArgs.cs
- OutputCacheSection.cs
- ParallelTimeline.cs
- WorkflowNamespace.cs
- ControlSerializer.cs
- TrackingProfileCache.cs
- QilSortKey.cs
- FtpWebResponse.cs
- TimeoutException.cs
- ColorIndependentAnimationStorage.cs
- TreeWalkHelper.cs
- SQLChars.cs
- ScrollEvent.cs
- HttpHandlerActionCollection.cs
- DocumentCollection.cs
- OdbcStatementHandle.cs
- ReleaseInstanceMode.cs
- ApplicationBuildProvider.cs
- InternalsVisibleToAttribute.cs
- MimeFormatExtensions.cs
- MessageQuerySet.cs
- TraceHandler.cs
- Choices.cs
- NeutralResourcesLanguageAttribute.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- ThrowHelper.cs
- ImageAutomationPeer.cs
- EmptyControlCollection.cs
- ImageMapEventArgs.cs
- HttpCapabilitiesEvaluator.cs
- BamlBinaryWriter.cs
- RotateTransform.cs
- Token.cs
- MonthCalendar.cs
- CachedPathData.cs
- FixedDocumentSequencePaginator.cs
- AbsoluteQuery.cs
- CodeGenHelper.cs
- GeneralTransform3D.cs
- ColorConvertedBitmap.cs
- StrongNameUtility.cs
- XmlReturnReader.cs
- XmlMapping.cs
- UIElementHelper.cs
- SharedStatics.cs
- DataGridViewIntLinkedList.cs
- PropertyIDSet.cs
- TableColumn.cs
- FontDifferentiator.cs
- DateTimeParse.cs
- CornerRadius.cs
- AttributeData.cs
- Converter.cs
- HttpModulesSection.cs
- InkCanvasAutomationPeer.cs
- APCustomTypeDescriptor.cs
- NamespaceInfo.cs
- OAVariantLib.cs
- PrintPageEvent.cs
- TextBox.cs
- OutOfMemoryException.cs
- HttpWebRequestElement.cs
- DataGridViewColumnConverter.cs
- RtType.cs
- DbException.cs
- WebProxyScriptElement.cs
- Int32.cs
- Composition.cs
- MessageQueueConverter.cs
- EncoderParameters.cs
- ConfigXmlSignificantWhitespace.cs
- WebConfigurationFileMap.cs
- BmpBitmapEncoder.cs
- DesignerProperties.cs
- ListViewGroupCollectionEditor.cs
- MemberPath.cs
- followingsibling.cs
- Soap.cs
- ExpressionsCollectionConverter.cs
- StylusPointPropertyInfoDefaults.cs
- XmlSchemaImporter.cs
- EditCommandColumn.cs
- IPHostEntry.cs
- ApplyTemplatesAction.cs
- EditorZoneBase.cs
- DocumentSchemaValidator.cs
- ReflectionHelper.cs
- DesignBindingValueUIHandler.cs
- Attributes.cs
- AlphaSortedEnumConverter.cs
- validationstate.cs