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
- InvalidEnumArgumentException.cs
- ByteStorage.cs
- ImageFormatConverter.cs
- SqlInternalConnectionSmi.cs
- OverrideMode.cs
- InvokeProviderWrapper.cs
- DelegatedStream.cs
- XmlFormatExtensionAttribute.cs
- ContentType.cs
- SecurityPolicySection.cs
- StateDesigner.Layouts.cs
- RegionIterator.cs
- ArcSegment.cs
- DetailsViewRowCollection.cs
- TrustManagerPromptUI.cs
- XmlILConstructAnalyzer.cs
- EntityDataSourceDesigner.cs
- FontSizeConverter.cs
- GeometryDrawing.cs
- TableHeaderCell.cs
- ResXBuildProvider.cs
- MetadataArtifactLoaderCompositeFile.cs
- PropertyEmitter.cs
- FixedFindEngine.cs
- FunctionNode.cs
- ConfigurationValue.cs
- EndEvent.cs
- SqlDataSourceQuery.cs
- DataBindingExpressionBuilder.cs
- Configuration.cs
- BindingObserver.cs
- ExceptionWrapper.cs
- Storyboard.cs
- CapabilitiesPattern.cs
- InstanceKeyCompleteException.cs
- DesignerAdRotatorAdapter.cs
- HwndHost.cs
- Matrix.cs
- StringKeyFrameCollection.cs
- DebugView.cs
- ConstantProjectedSlot.cs
- SiteMapPath.cs
- PopupRootAutomationPeer.cs
- FileAuthorizationModule.cs
- OleDbParameterCollection.cs
- SolidColorBrush.cs
- GeneralTransform3DCollection.cs
- SqlClientPermission.cs
- MsdtcWrapper.cs
- CreateUserWizardAutoFormat.cs
- DependencyObjectValidator.cs
- ValueUnavailableException.cs
- TaiwanLunisolarCalendar.cs
- LocalValueEnumerator.cs
- XmlAtomicValue.cs
- RegexTree.cs
- WeakReference.cs
- LinqDataSourceDisposeEventArgs.cs
- CodeTypeReference.cs
- ContentTypeSettingClientMessageFormatter.cs
- OutputCacheModule.cs
- ToolStripMenuItem.cs
- DecimalAnimationUsingKeyFrames.cs
- Menu.cs
- Parallel.cs
- SkipQueryOptionExpression.cs
- Ports.cs
- WebPartsPersonalization.cs
- DataKey.cs
- MessageLogTraceRecord.cs
- Types.cs
- XmlAutoDetectWriter.cs
- DataBoundControlParameterTarget.cs
- httpserverutility.cs
- SqlError.cs
- SafeSecurityHandles.cs
- PropVariant.cs
- ImageMapEventArgs.cs
- RegexRunner.cs
- Point3DIndependentAnimationStorage.cs
- SqlInternalConnectionSmi.cs
- TextParagraphCache.cs
- QueueProcessor.cs
- DesignerActionTextItem.cs
- FixedFlowMap.cs
- TextTabProperties.cs
- BamlBinaryReader.cs
- PropertyChangedEventArgs.cs
- SqlFlattener.cs
- ConfigsHelper.cs
- Freezable.cs
- XmlSerializationWriter.cs
- DocumentSequence.cs
- Int16AnimationUsingKeyFrames.cs
- ActivityExecutionContext.cs
- LinkDesigner.cs
- EdmSchemaAttribute.cs
- ChtmlTextWriter.cs
- DeviceContexts.cs
- HelpKeywordAttribute.cs