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
- assemblycache.cs
- WindowsScrollBarBits.cs
- SecureUICommand.cs
- XPathScanner.cs
- WS2007FederationHttpBindingElement.cs
- ProviderConnectionPoint.cs
- OracleBoolean.cs
- ResourcePermissionBaseEntry.cs
- SystemWebCachingSectionGroup.cs
- AddInController.cs
- ResXFileRef.cs
- ScriptResourceAttribute.cs
- Point3DCollectionConverter.cs
- CustomAttributeBuilder.cs
- HttpListenerResponse.cs
- StringOutput.cs
- InputGestureCollection.cs
- RadioButton.cs
- MulticastIPAddressInformationCollection.cs
- ContractReference.cs
- DiagnosticStrings.cs
- FileDialogCustomPlacesCollection.cs
- BinaryKeyIdentifierClause.cs
- ColorMap.cs
- Itemizer.cs
- ExpressionTextBox.xaml.cs
- DummyDataSource.cs
- XmlNodeReader.cs
- ProfileGroupSettings.cs
- EUCJPEncoding.cs
- DrawingGroupDrawingContext.cs
- WindowsHyperlink.cs
- PageBuildProvider.cs
- Boolean.cs
- DirectoryInfo.cs
- IArgumentProvider.cs
- ConnectionProviderAttribute.cs
- SwitchAttribute.cs
- xmlformatgeneratorstatics.cs
- SchemaMapping.cs
- XmlElementList.cs
- RegexTree.cs
- ImageSourceValueSerializer.cs
- RepeatButton.cs
- ListBase.cs
- ToolStripArrowRenderEventArgs.cs
- HWStack.cs
- URLAttribute.cs
- WebPartTransformer.cs
- ModuleElement.cs
- DbConnectionStringCommon.cs
- ChangeDirector.cs
- ProxyFragment.cs
- CodeTypeReferenceCollection.cs
- brushes.cs
- InstanceDataCollectionCollection.cs
- ListViewGroupCollectionEditor.cs
- DbModificationCommandTree.cs
- TimerExtension.cs
- Event.cs
- MbpInfo.cs
- XPathCompileException.cs
- UpdatePanelTriggerCollection.cs
- URLAttribute.cs
- RadialGradientBrush.cs
- ZipIOLocalFileDataDescriptor.cs
- XmlArrayAttribute.cs
- Mutex.cs
- WebPartEditorOkVerb.cs
- EventDescriptorCollection.cs
- CapabilitiesUse.cs
- DoubleConverter.cs
- TypeConverter.cs
- ServiceChannelFactory.cs
- MethodSet.cs
- input.cs
- SecurityPolicySection.cs
- figurelengthconverter.cs
- XmlDataImplementation.cs
- DialogWindow.cs
- ListViewGroup.cs
- AnnotationResourceCollection.cs
- HostedHttpRequestAsyncResult.cs
- IntSecurity.cs
- RuntimeVariablesExpression.cs
- ButtonPopupAdapter.cs
- JsonObjectDataContract.cs
- ListViewItemSelectionChangedEvent.cs
- DesignConnectionCollection.cs
- ReturnValue.cs
- ConnectionConsumerAttribute.cs
- CalendarDateChangedEventArgs.cs
- ResourceReferenceExpressionConverter.cs
- Header.cs
- X509Certificate2.cs
- xml.cs
- XmlWriterTraceListener.cs
- DataGridViewLinkColumn.cs
- TypeNameConverter.cs
- safelink.cs