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
- Converter.cs
- TextureBrush.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- SHA512.cs
- DetailsViewDeleteEventArgs.cs
- RegexStringValidatorAttribute.cs
- HttpResponseHeader.cs
- AddInToken.cs
- IdnMapping.cs
- HTTP_SERVICE_CONFIG_URLACL_KEY.cs
- Symbol.cs
- TextServicesDisplayAttribute.cs
- webclient.cs
- XmlDownloadManager.cs
- EntityDataSourceEntityTypeFilterItem.cs
- GridViewItemAutomationPeer.cs
- MinMaxParagraphWidth.cs
- SafeRightsManagementQueryHandle.cs
- DataPagerCommandEventArgs.cs
- CannotUnloadAppDomainException.cs
- _CommandStream.cs
- FrameDimension.cs
- SmiRecordBuffer.cs
- SimpleMailWebEventProvider.cs
- DBAsyncResult.cs
- HttpModuleAction.cs
- MaterialGroup.cs
- TrackingStringDictionary.cs
- InputEventArgs.cs
- NavigationEventArgs.cs
- WebPartConnectionsEventArgs.cs
- _UriSyntax.cs
- XsdDataContractImporter.cs
- SynchronizationContext.cs
- TransformationRules.cs
- SqlCommand.cs
- Popup.cs
- AppSettingsSection.cs
- SqlProviderUtilities.cs
- CookieParameter.cs
- WebPartChrome.cs
- ConfigurationStrings.cs
- DataStreams.cs
- ExceptionHelpers.cs
- ContractCodeDomInfo.cs
- StickyNoteAnnotations.cs
- DataChangedEventManager.cs
- Section.cs
- AppSettingsReader.cs
- SchemaNotation.cs
- EntityModelBuildProvider.cs
- MultiDataTrigger.cs
- DecimalAnimationBase.cs
- OutputScopeManager.cs
- ToolStripItemClickedEventArgs.cs
- ThreadStartException.cs
- DataSourceSelectArguments.cs
- WindowProviderWrapper.cs
- DesignerImageAdapter.cs
- LocalIdKeyIdentifierClause.cs
- InvokeProviderWrapper.cs
- BulletedList.cs
- ProviderMetadataCachedInformation.cs
- XslTransform.cs
- UrlMappingsModule.cs
- MsmqHostedTransportConfiguration.cs
- UserInitiatedNavigationPermission.cs
- CapabilitiesPattern.cs
- CodeTypeDelegate.cs
- UseManagedPresentationBindingElement.cs
- FilterException.cs
- SqlTriggerAttribute.cs
- BindingExpressionUncommonField.cs
- XmlSchemaAny.cs
- VBIdentifierDesigner.xaml.cs
- SolidColorBrush.cs
- Models.cs
- ButtonChrome.cs
- EmptyEnumerator.cs
- Terminate.cs
- EntityModelSchemaGenerator.cs
- ColumnMapProcessor.cs
- SchemaImporterExtension.cs
- XmlSchemaAppInfo.cs
- ResourceReferenceKeyNotFoundException.cs
- nulltextnavigator.cs
- MemoryStream.cs
- Marshal.cs
- ImageKeyConverter.cs
- ZeroOpNode.cs
- ExtendedPropertyDescriptor.cs
- SafeProcessHandle.cs
- TextParagraphCache.cs
- __Filters.cs
- SchemaAttDef.cs
- MobileUITypeEditor.cs
- ContourSegment.cs
- Automation.cs
- StrokeNodeOperations2.cs
- webproxy.cs