Code:
/ DotNET / DotNET / 8.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
- ConnectionStringSettingsCollection.cs
- PageAsyncTaskManager.cs
- PrintPreviewControl.cs
- ReadOnlyPermissionSet.cs
- CroppedBitmap.cs
- PropertyFilterAttribute.cs
- ServiceParser.cs
- TraceHelpers.cs
- StyleSheetComponentEditor.cs
- DocumentOrderQuery.cs
- PropertyEmitterBase.cs
- TripleDES.cs
- TableChangeProcessor.cs
- Matrix3DStack.cs
- SessionStateItemCollection.cs
- ComponentResourceKey.cs
- IDataContractSurrogate.cs
- AllMembershipCondition.cs
- TextInfo.cs
- CurrencyWrapper.cs
- RouteItem.cs
- WebPartTransformer.cs
- ColumnBinding.cs
- ColumnResizeAdorner.cs
- Serializer.cs
- PopupRoot.cs
- EntityTemplateFactory.cs
- ExportOptions.cs
- DependencySource.cs
- CodeConditionStatement.cs
- RegexCharClass.cs
- PointAnimation.cs
- MediaPlayer.cs
- ServerType.cs
- PersistenceTypeAttribute.cs
- XmlAggregates.cs
- DSASignatureFormatter.cs
- PixelShader.cs
- FloaterBaseParaClient.cs
- BindingContext.cs
- TextTreeNode.cs
- ApplicationFileCodeDomTreeGenerator.cs
- SqlSelectStatement.cs
- ZipIOLocalFileHeader.cs
- OleDbWrapper.cs
- NativeMethods.cs
- DataGridViewRowStateChangedEventArgs.cs
- SectionXmlInfo.cs
- AssemblySettingAttributes.cs
- FacetEnabledSchemaElement.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- TraceContextEventArgs.cs
- MaterialGroup.cs
- EntityDataSourceWrapper.cs
- SuppressMessageAttribute.cs
- InternalCache.cs
- ReservationCollection.cs
- Brush.cs
- StrongNameMembershipCondition.cs
- Size3D.cs
- Win32Native.cs
- Claim.cs
- UserControlParser.cs
- AsyncResult.cs
- SqlDataSourceCustomCommandEditor.cs
- SessionEndingCancelEventArgs.cs
- SafeCertificateContext.cs
- HiddenField.cs
- ControlValuePropertyAttribute.cs
- HtmlTernaryTree.cs
- SqlBooleanMismatchVisitor.cs
- ConfigErrorGlyph.cs
- Point3DCollectionConverter.cs
- DataPointer.cs
- MsmqHostedTransportManager.cs
- CannotUnloadAppDomainException.cs
- ValueTypeFixupInfo.cs
- DesignerForm.cs
- PresentationAppDomainManager.cs
- CollectionChangeEventArgs.cs
- Internal.cs
- LinkLabel.cs
- PhysicalFontFamily.cs
- SqlClientFactory.cs
- EncoderParameters.cs
- PropertyGeneratedEventArgs.cs
- EventToken.cs
- XmlValidatingReaderImpl.cs
- ContainerParaClient.cs
- CharacterBuffer.cs
- FacetValues.cs
- ReferenceCountedObject.cs
- AlternateView.cs
- TriggerActionCollection.cs
- RectConverter.cs
- documentsequencetextview.cs
- jithelpers.cs
- BinaryObjectInfo.cs
- MappedMetaModel.cs
- TypeSchema.cs