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
- XmlSerializerNamespaces.cs
- NativeMethods.cs
- shaperfactoryquerycacheentry.cs
- PipeStream.cs
- UInt64.cs
- Registry.cs
- EncodingFallbackAwareXmlTextWriter.cs
- SqlCaseSimplifier.cs
- WebPartMenu.cs
- DemultiplexingDispatchMessageFormatter.cs
- UInt64Converter.cs
- StatusBarPanel.cs
- IPEndPoint.cs
- Math.cs
- CaretElement.cs
- ActivityTypeResolver.xaml.cs
- GradientBrush.cs
- SID.cs
- ToolboxComponentsCreatingEventArgs.cs
- DoubleAnimation.cs
- XmlSchemaSimpleContentExtension.cs
- BitmapMetadataEnumerator.cs
- RowVisual.cs
- EndpointBehaviorElement.cs
- DBSchemaTable.cs
- DetailsViewDeletedEventArgs.cs
- ToolStripOverflow.cs
- CustomValidator.cs
- FixedDocumentSequencePaginator.cs
- OptionUsage.cs
- HWStack.cs
- CompilationUnit.cs
- DataColumnCollection.cs
- HtmlInputSubmit.cs
- ControlPaint.cs
- SettingsContext.cs
- QilReplaceVisitor.cs
- NoneExcludedImageIndexConverter.cs
- TextPatternIdentifiers.cs
- BatchWriter.cs
- ISAPIWorkerRequest.cs
- GeneralTransform.cs
- FormsAuthenticationTicket.cs
- StreamWriter.cs
- XamlReader.cs
- UInt64.cs
- StylusPointDescription.cs
- ObjectDataSourceFilteringEventArgs.cs
- XmlSchemaGroupRef.cs
- _SafeNetHandles.cs
- BodyGlyph.cs
- ProcessInfo.cs
- DataObjectCopyingEventArgs.cs
- SoapMessage.cs
- _NestedSingleAsyncResult.cs
- SetStoryboardSpeedRatio.cs
- SharedDp.cs
- MediaElementAutomationPeer.cs
- MarkupObject.cs
- KeyedHashAlgorithm.cs
- FloatAverageAggregationOperator.cs
- PlatformNotSupportedException.cs
- RelativeSource.cs
- CustomLineCap.cs
- QueryMath.cs
- EntityContainerRelationshipSet.cs
- LongTypeConverter.cs
- ReferencedCollectionType.cs
- Crc32.cs
- RowUpdatingEventArgs.cs
- ContextStaticAttribute.cs
- ServiceBuildProvider.cs
- KeyedCollection.cs
- Util.cs
- ScriptControl.cs
- WithStatement.cs
- RootBrowserWindowAutomationPeer.cs
- ElementMarkupObject.cs
- UncommonField.cs
- Connector.cs
- MSAANativeProvider.cs
- SoapSchemaImporter.cs
- WeakReadOnlyCollection.cs
- SqlExpander.cs
- XmlAttributeAttribute.cs
- ZipIOExtraFieldZip64Element.cs
- DBDataPermissionAttribute.cs
- ChannelSinkStacks.cs
- FormatConvertedBitmap.cs
- SizeFConverter.cs
- JsonFormatGeneratorStatics.cs
- TreeChangeInfo.cs
- ApplicationFileCodeDomTreeGenerator.cs
- EnumValidator.cs
- MeasureItemEvent.cs
- SerializationObjectManager.cs
- CollectionConverter.cs
- StrokeNodeOperations.cs
- ProbeDuplexCD1AsyncResult.cs
- ServiceObjectContainer.cs