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
- PropertyRef.cs
- Timer.cs
- ConfigXmlDocument.cs
- SyntaxCheck.cs
- ListBase.cs
- PageWrapper.cs
- HealthMonitoringSectionHelper.cs
- BaseCAMarshaler.cs
- RegionData.cs
- AdjustableArrowCap.cs
- AstNode.cs
- LayoutEvent.cs
- RSAOAEPKeyExchangeFormatter.cs
- PatternMatcher.cs
- AuthenticationException.cs
- Stack.cs
- EventArgs.cs
- basevalidator.cs
- RegistryDataKey.cs
- PropertyGridCommands.cs
- EventProvider.cs
- GPRECTF.cs
- WebPartVerbCollection.cs
- TextRange.cs
- XmlSchemaSubstitutionGroup.cs
- SystemInformation.cs
- ResourceType.cs
- ObjectDataSource.cs
- DataGridViewCell.cs
- DtdParser.cs
- ListControl.cs
- DateTime.cs
- UInt16.cs
- PrintingPermissionAttribute.cs
- QfeChecker.cs
- DataComponentMethodGenerator.cs
- LassoSelectionBehavior.cs
- SourceChangedEventArgs.cs
- _BufferOffsetSize.cs
- SchemaEntity.cs
- DeclarativeCatalogPart.cs
- DataGridViewColumn.cs
- PeerEndPoint.cs
- DataGridViewAdvancedBorderStyle.cs
- VirtualDirectoryMapping.cs
- PrintingPermission.cs
- ProgressPage.cs
- DataGridViewColumnCollection.cs
- StartUpEventArgs.cs
- DefaultBinder.cs
- DesignerCategoryAttribute.cs
- WrappedIUnknown.cs
- FileNotFoundException.cs
- DbProviderSpecificTypePropertyAttribute.cs
- TextParentUndoUnit.cs
- AppDomainProtocolHandler.cs
- QueryableDataSourceHelper.cs
- TrackingDataItemValue.cs
- HttpModuleActionCollection.cs
- ToolStripStatusLabel.cs
- TreeNode.cs
- DataTableTypeConverter.cs
- PriorityBinding.cs
- EntitySetBase.cs
- HotCommands.cs
- SafeCertificateStore.cs
- BaseCAMarshaler.cs
- EventLog.cs
- BackgroundFormatInfo.cs
- ChannelManagerBase.cs
- EnumerableCollectionView.cs
- EdmProperty.cs
- MexTcpBindingElement.cs
- XmlDocumentFragment.cs
- SessionStateModule.cs
- DataSourceCache.cs
- FrameworkElement.cs
- ExtendedPropertyDescriptor.cs
- ConstrainedGroup.cs
- RelOps.cs
- SiteMembershipCondition.cs
- GroupItemAutomationPeer.cs
- VideoDrawing.cs
- PathStreamGeometryContext.cs
- InputElement.cs
- PeerService.cs
- XmlCustomFormatter.cs
- HttpResponse.cs
- SendMailErrorEventArgs.cs
- DataAccessor.cs
- TdsParserSessionPool.cs
- DomNameTable.cs
- TypeNameHelper.cs
- CacheEntry.cs
- CacheMemory.cs
- GeneratedCodeAttribute.cs
- KeyGesture.cs
- InvariantComparer.cs
- SiteMapNodeItem.cs
- QueueAccessMode.cs