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
- StringArrayConverter.cs
- SQLBytes.cs
- QuaternionConverter.cs
- StandardMenuStripVerb.cs
- PropertyGroupDescription.cs
- BuildProviderCollection.cs
- SoapAttributes.cs
- Vector3DAnimationBase.cs
- PageContentAsyncResult.cs
- ApplicationInfo.cs
- RegexGroup.cs
- ToolBarOverflowPanel.cs
- ToolStrip.cs
- X509KeyIdentifierClauseType.cs
- TrustSection.cs
- WeakHashtable.cs
- RecordBuilder.cs
- EntityDataSourceDesigner.cs
- SecurityCriticalDataForSet.cs
- AnonymousIdentificationModule.cs
- DrawListViewItemEventArgs.cs
- ContentType.cs
- StreamSecurityUpgradeAcceptor.cs
- ObjectItemNoOpAssemblyLoader.cs
- BinaryConverter.cs
- ApplicationFileCodeDomTreeGenerator.cs
- StylusPointProperties.cs
- ColorTranslator.cs
- TriggerActionCollection.cs
- XPathAncestorQuery.cs
- IisTraceWebEventProvider.cs
- DetailsViewInsertedEventArgs.cs
- XmlTextWriter.cs
- Assert.cs
- TdsParameterSetter.cs
- ColumnClickEvent.cs
- SegmentInfo.cs
- hresults.cs
- ConnectorDragDropGlyph.cs
- ProxyAttribute.cs
- CatalogZoneDesigner.cs
- AssertFilter.cs
- RijndaelManagedTransform.cs
- XmlIlVisitor.cs
- InputLangChangeEvent.cs
- EdmProviderManifest.cs
- ComponentEditorForm.cs
- DataTableMappingCollection.cs
- RootBuilder.cs
- ConfigurationException.cs
- ConfigurationLockCollection.cs
- DoubleLinkListEnumerator.cs
- InteropAutomationProvider.cs
- MultiSelector.cs
- WMIInterop.cs
- WebColorConverter.cs
- X509Certificate.cs
- MultipartIdentifier.cs
- PresentationAppDomainManager.cs
- Light.cs
- RoleGroup.cs
- GeometryGroup.cs
- ValuePatternIdentifiers.cs
- UrlMapping.cs
- RootProjectionNode.cs
- TextPattern.cs
- QilTargetType.cs
- ReadOnlyHierarchicalDataSource.cs
- XslTransform.cs
- MemberDescriptor.cs
- ProgressBarHighlightConverter.cs
- CompositeActivityMarkupSerializer.cs
- Socket.cs
- XsdDateTime.cs
- UnknownBitmapDecoder.cs
- TTSEvent.cs
- TypedMessageConverter.cs
- BindingGraph.cs
- TextTrailingWordEllipsis.cs
- DataGridViewColumnStateChangedEventArgs.cs
- AssemblyAttributes.cs
- CodeValidator.cs
- ViewCellRelation.cs
- SequenceDesignerAccessibleObject.cs
- ConnectionManager.cs
- WebPartMovingEventArgs.cs
- XmlSchemaGroupRef.cs
- DbSourceCommand.cs
- Typography.cs
- Aggregates.cs
- SendActivityEventArgs.cs
- AddInServer.cs
- DbInsertCommandTree.cs
- Version.cs
- DataTableCollection.cs
- BoolExpressionVisitors.cs
- MetadataSource.cs
- RegexStringValidator.cs
- PartialCachingAttribute.cs
- ReferenceService.cs