Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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")); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CreateParams.cs
- NativeDirectoryServicesQueryAPIs.cs
- DbProviderFactory.cs
- TemplatedMailWebEventProvider.cs
- CellTreeNodeVisitors.cs
- DbCommandDefinition.cs
- SubMenuStyleCollectionEditor.cs
- XmlSchemaObjectCollection.cs
- DiagnosticTrace.cs
- ProviderIncompatibleException.cs
- NavigationPropertyEmitter.cs
- DrawingCollection.cs
- CompositionTarget.cs
- ExtensionSimplifierMarkupObject.cs
- HttpUnhandledOperationInvoker.cs
- Geometry3D.cs
- ManagedWndProcTracker.cs
- DbConnectionStringBuilder.cs
- HybridDictionary.cs
- GenericPrincipal.cs
- Deflater.cs
- DependencyPropertyAttribute.cs
- ToolStripGrip.cs
- ColorPalette.cs
- MouseButtonEventArgs.cs
- X509CertificateStore.cs
- ProfileSettingsCollection.cs
- WindowsGraphicsCacheManager.cs
- KoreanLunisolarCalendar.cs
- ISAPIRuntime.cs
- WithStatement.cs
- Propagator.ExtentPlaceholderCreator.cs
- FixedSOMPage.cs
- GridViewUpdatedEventArgs.cs
- ADMembershipUser.cs
- cookie.cs
- ResponseBodyWriter.cs
- Pair.cs
- _ProxyChain.cs
- HandleRef.cs
- OleDbEnumerator.cs
- WizardStepCollectionEditor.cs
- InterleavedZipPartStream.cs
- Policy.cs
- SqlColumnizer.cs
- DataContractSerializerOperationBehavior.cs
- SqlAliasesReferenced.cs
- arclist.cs
- XmlDataImplementation.cs
- HwndAppCommandInputProvider.cs
- ClientSettingsStore.cs
- ObjectHandle.cs
- AccessKeyManager.cs
- ActivityDesignerLayoutSerializers.cs
- TimeSpanParse.cs
- GridViewActionList.cs
- SudsParser.cs
- CanonicalFontFamilyReference.cs
- CompoundFileReference.cs
- ConsumerConnectionPointCollection.cs
- ImageAnimator.cs
- NullableBoolConverter.cs
- UIElement.cs
- CodeRegionDirective.cs
- TextPointer.cs
- CapabilitiesPattern.cs
- EntityDataSourceState.cs
- TileBrush.cs
- ProfileParameter.cs
- PropagatorResult.cs
- Baml2006Reader.cs
- ServicePoint.cs
- DriveInfo.cs
- ResourcesChangeInfo.cs
- MasterPageCodeDomTreeGenerator.cs
- MetabaseReader.cs
- GroupBox.cs
- FormatException.cs
- ModelVisual3D.cs
- HttpCookie.cs
- MasterPage.cs
- Char.cs
- Soap.cs
- WCFBuildProvider.cs
- ButtonStandardAdapter.cs
- uribuilder.cs
- TextSchema.cs
- ListViewCancelEventArgs.cs
- BinaryFormatter.cs
- RecordsAffectedEventArgs.cs
- XmlBufferReader.cs
- MdImport.cs
- WeakEventTable.cs
- AssemblyNameProxy.cs
- EnumerableWrapperWeakToStrong.cs
- SingleAnimation.cs
- BitmapData.cs
- HtmlInputReset.cs
- DeferredSelectedIndexReference.cs
- RemotingServices.cs