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
- EntityDataSourceStatementEditorForm.cs
- InternalControlCollection.cs
- Model3D.cs
- ConditionBrowserDialog.cs
- ByeOperation11AsyncResult.cs
- XPathBuilder.cs
- Point4D.cs
- SmiConnection.cs
- DesignerEditorPartChrome.cs
- FtpWebRequest.cs
- XmlSchemaAttributeGroupRef.cs
- StyleSheet.cs
- Common.cs
- AddInStore.cs
- XmlFormatWriterGenerator.cs
- UserControlCodeDomTreeGenerator.cs
- LambdaCompiler.Generated.cs
- TimeoutTimer.cs
- Operators.cs
- DBCommand.cs
- PropertyKey.cs
- CodeFieldReferenceExpression.cs
- StringReader.cs
- CollectionViewGroupInternal.cs
- ConnectionsZoneAutoFormat.cs
- IntSecurity.cs
- BufferModesCollection.cs
- FunctionMappingTranslator.cs
- SchemaImporterExtension.cs
- CodeDirectiveCollection.cs
- TableAdapterManagerHelper.cs
- InvokeBinder.cs
- SamlAuthenticationClaimResource.cs
- TypeListConverter.cs
- RawStylusInputCustomData.cs
- DocumentsTrace.cs
- ThreadWorkerController.cs
- AudioDeviceOut.cs
- Misc.cs
- UpdateDelegates.Generated.cs
- ConfigUtil.cs
- CodeGroup.cs
- AppDomainManager.cs
- RenderDataDrawingContext.cs
- SqlBinder.cs
- ContextInformation.cs
- DiscoveryReferences.cs
- loginstatus.cs
- ValueConversionAttribute.cs
- DescendantQuery.cs
- IssuedTokenParametersEndpointAddressElement.cs
- CodeIdentifier.cs
- RawStylusInput.cs
- TextRangeEdit.cs
- GlyphRunDrawing.cs
- RectangleHotSpot.cs
- ProviderSettingsCollection.cs
- FamilyMapCollection.cs
- Vertex.cs
- TypeInfo.cs
- BuildProviderAppliesToAttribute.cs
- documentsequencetextview.cs
- QueryCacheManager.cs
- ColumnBinding.cs
- SqlDeflator.cs
- DataGridViewRowCollection.cs
- HtmlListAdapter.cs
- UInt32Converter.cs
- SingleTagSectionHandler.cs
- UnsafeNativeMethodsPenimc.cs
- UmAlQuraCalendar.cs
- DataControlImageButton.cs
- EntityDataSourceUtil.cs
- PageAsyncTaskManager.cs
- EventArgs.cs
- PackageRelationshipCollection.cs
- SqlMethods.cs
- SHA384.cs
- DataGridViewIntLinkedList.cs
- WebSysDescriptionAttribute.cs
- SByteConverter.cs
- StackOverflowException.cs
- OleDbConnectionFactory.cs
- Point4D.cs
- SecurityHelper.cs
- Screen.cs
- XmlSchemaAnyAttribute.cs
- EventLogRecord.cs
- DesignerTransaction.cs
- XmlIlVisitor.cs
- cookiecollection.cs
- WebHostUnsafeNativeMethods.cs
- WizardStepBase.cs
- MethodBuilderInstantiation.cs
- ConsoleCancelEventArgs.cs
- SqlConnectionPoolProviderInfo.cs
- XmlSchemaAppInfo.cs
- log.cs
- PolyBezierSegment.cs
- HostingEnvironmentWrapper.cs