Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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")); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SerialErrors.cs
- DelegatingConfigHost.cs
- TextParaLineResult.cs
- Convert.cs
- PtsHelper.cs
- AnonymousIdentificationSection.cs
- _ScatterGatherBuffers.cs
- Geometry.cs
- PaginationProgressEventArgs.cs
- AsyncCodeActivity.cs
- BlurBitmapEffect.cs
- Rotation3D.cs
- BaseTransportHeaders.cs
- ListMarkerLine.cs
- PartitionedStream.cs
- LambdaReference.cs
- DirectoryInfo.cs
- ComponentEditorPage.cs
- CodeRemoveEventStatement.cs
- DotExpr.cs
- StandardBindingOptionalReliableSessionElement.cs
- NumericPagerField.cs
- AppSettingsReader.cs
- CapabilitiesRule.cs
- InsufficientMemoryException.cs
- MetadataArtifactLoader.cs
- MessageEventSubscriptionService.cs
- WebConfigurationHost.cs
- ZipIOModeEnforcingStream.cs
- CommandExpr.cs
- WebBrowserProgressChangedEventHandler.cs
- FormatException.cs
- PerformanceCounterLib.cs
- ExpressionBindings.cs
- ExpandSegment.cs
- DesignerSerializerAttribute.cs
- CaseKeyBox.xaml.cs
- CanonicalXml.cs
- SystemPens.cs
- _RequestCacheProtocol.cs
- ExtentCqlBlock.cs
- CalendarDesigner.cs
- ProfileParameter.cs
- SqlCommand.cs
- ProcessModuleCollection.cs
- ProxyWebPartConnectionCollection.cs
- VectorConverter.cs
- SoundPlayer.cs
- CapabilitiesPattern.cs
- TypeDependencyAttribute.cs
- DataReaderContainer.cs
- SerializationEventsCache.cs
- RelationshipWrapper.cs
- CanonicalizationDriver.cs
- LicFileLicenseProvider.cs
- TableLayoutStyleCollection.cs
- OnOperation.cs
- Visual3D.cs
- Rect3DConverter.cs
- RenderContext.cs
- HttpHandlersSection.cs
- ZoneMembershipCondition.cs
- Cursors.cs
- SharedStatics.cs
- CodePrimitiveExpression.cs
- WsdlInspector.cs
- Brushes.cs
- ValueUnavailableException.cs
- NotifyParentPropertyAttribute.cs
- EventSetter.cs
- HTMLTextWriter.cs
- AppSecurityManager.cs
- SafeCertificateStore.cs
- ConfigurationStrings.cs
- ToRequest.cs
- ContractsBCL.cs
- DesignerSerializationVisibilityAttribute.cs
- DocumentSchemaValidator.cs
- AppDomainManager.cs
- HelpInfo.cs
- CompilerCollection.cs
- Image.cs
- UriTemplateTrieNode.cs
- ListChunk.cs
- DocumentViewer.cs
- DesignTimeParseData.cs
- BoolExpression.cs
- WebException.cs
- BooleanAnimationBase.cs
- AppModelKnownContentFactory.cs
- SerializationHelper.cs
- PageContentCollection.cs
- MetadataFile.cs
- XPathSelfQuery.cs
- ProcessProtocolHandler.cs
- IdentityVerifier.cs
- ListSortDescription.cs
- HwndAppCommandInputProvider.cs
- CircleHotSpot.cs
- ConfigurationSectionCollection.cs