Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- DetailsViewDeletedEventArgs.cs
- OptimalTextSource.cs
- RoleGroupCollection.cs
- AnimatedTypeHelpers.cs
- DataChangedEventManager.cs
- ProfileServiceManager.cs
- WebPartsPersonalization.cs
- DataSetMappper.cs
- CompositeControl.cs
- EventProviderWriter.cs
- CredentialCache.cs
- AgileSafeNativeMemoryHandle.cs
- AggregateNode.cs
- IsolatedStoragePermission.cs
- DataGridViewCheckBoxCell.cs
- ChildTable.cs
- StructuredTypeInfo.cs
- EventSetterHandlerConverter.cs
- _AutoWebProxyScriptEngine.cs
- EntityDataSourceState.cs
- EntityDesignerBuildProvider.cs
- DocumentSequence.cs
- ReadOnlyDictionary.cs
- InstanceHandle.cs
- CardSpaceSelector.cs
- XPathSelfQuery.cs
- CalculatedColumn.cs
- EntityDataSourceSelectedEventArgs.cs
- HtmlTextArea.cs
- ContentPathSegment.cs
- OdbcHandle.cs
- MimeFormReflector.cs
- TreeNodeSelectionProcessor.cs
- MenuItemCollection.cs
- ButtonBase.cs
- SecurityDocument.cs
- UserControlAutomationPeer.cs
- CodeTypeDeclarationCollection.cs
- FixUpCollection.cs
- CalendarAutomationPeer.cs
- TextEffect.cs
- ZipIOFileItemStream.cs
- UnauthorizedAccessException.cs
- RowParagraph.cs
- HwndSourceParameters.cs
- TokenBasedSetEnumerator.cs
- SelectionChangedEventArgs.cs
- TypeBuilder.cs
- PinnedBufferMemoryStream.cs
- ReadOnlyCollectionBase.cs
- RouteUrlExpressionBuilder.cs
- TdsEnums.cs
- FileDialog_Vista.cs
- AdCreatedEventArgs.cs
- DataGridViewCellStyleEditor.cs
- TextEffectResolver.cs
- XmlArrayItemAttributes.cs
- XmlDomTextWriter.cs
- Stopwatch.cs
- COAUTHIDENTITY.cs
- XmlToDatasetMap.cs
- DrawingVisualDrawingContext.cs
- ResourceContainer.cs
- Memoizer.cs
- XmlElementAttribute.cs
- IsolatedStorageFileStream.cs
- OperationContractGenerationContext.cs
- CompiledQuery.cs
- FunctionMappingTranslator.cs
- AvtEvent.cs
- DesigntimeLicenseContext.cs
- KeyNameIdentifierClause.cs
- IIS7WorkerRequest.cs
- CommandBinding.cs
- LoadItemsEventArgs.cs
- IMembershipProvider.cs
- SqlVisitor.cs
- FusionWrap.cs
- SessionParameter.cs
- BulletDecorator.cs
- ScriptingSectionGroup.cs
- MediaElementAutomationPeer.cs
- DynamicMetaObjectBinder.cs
- UnmanagedMarshal.cs
- Asn1Utilities.cs
- Inline.cs
- SByte.cs
- InvocationExpression.cs
- TcpProcessProtocolHandler.cs
- CommandLibraryHelper.cs
- LoginView.cs
- XmlSerializerAssemblyAttribute.cs
- RoleService.cs
- UnsafeNativeMethods.cs
- SettingsSection.cs
- WebInvokeAttribute.cs
- ConsoleEntryPoint.cs
- HTTPRemotingHandler.cs
- Header.cs
- GrammarBuilderBase.cs