Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / clr / src / BCL / System / MissingMemberException.cs / 1 / MissingMemberException.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================================== ** ** Class: MissingMemberException ** ** ** Purpose: The exception class for versioning problems with DLLS. ** ** =============================================================================*/ namespace System { using System; using System.Runtime.Remoting; using System.Runtime.Serialization; using System.Runtime.CompilerServices; using System.Globalization; using System.Security.Permissions; [System.Runtime.InteropServices.ComVisible(true)] [Serializable] public class MissingMemberException : MemberAccessException, ISerializable { public MissingMemberException() : base(Environment.GetResourceString("Arg_MissingMemberException")) { SetErrorCode(__HResults.COR_E_MISSINGMEMBER); } public MissingMemberException(String message) : base(message) { SetErrorCode(__HResults.COR_E_MISSINGMEMBER); } public MissingMemberException(String message, Exception inner) : base(message, inner) { SetErrorCode(__HResults.COR_E_MISSINGMEMBER); } protected MissingMemberException(SerializationInfo info, StreamingContext context) : base (info, context) { ClassName = (String)info.GetString("MMClassName"); MemberName = (String)info.GetString("MMMemberName"); Signature = (byte[])info.GetValue("MMSignature", typeof(byte[])); } public override String Message { get { if (ClassName == null) { return base.Message; } else { // do any desired fixups to classname here. return String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("MissingMember_Name", ClassName + "." + MemberName + (Signature != null ? " " + FormatSignature(Signature) : ""))); } } } // Called to format signature [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern String FormatSignature(byte [] signature); // Potentially called from the EE private MissingMemberException(String className, String memberName, byte[] signature) { ClassName = className; MemberName = memberName; Signature = signature; } public MissingMemberException(String className, String memberName) { ClassName = className; MemberName = memberName; } [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.SerializationFormatter)] public override void GetObjectData(SerializationInfo info, StreamingContext context) { if (info==null) { throw new ArgumentNullException("info"); } base.GetObjectData(info, context); info.AddValue("MMClassName", ClassName, typeof(String)); info.AddValue("MMMemberName", MemberName, typeof(String)); info.AddValue("MMSignature", Signature, typeof(byte[])); } // If ClassName != null, GetMessage will construct on the fly using it // and the other variables. This allows customization of the // format depending on the language environment. protected String ClassName; protected String MemberName; protected byte[] Signature; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================================== ** ** Class: MissingMemberException ** ** ** Purpose: The exception class for versioning problems with DLLS. ** ** =============================================================================*/ namespace System { using System; using System.Runtime.Remoting; using System.Runtime.Serialization; using System.Runtime.CompilerServices; using System.Globalization; using System.Security.Permissions; [System.Runtime.InteropServices.ComVisible(true)] [Serializable] public class MissingMemberException : MemberAccessException, ISerializable { public MissingMemberException() : base(Environment.GetResourceString("Arg_MissingMemberException")) { SetErrorCode(__HResults.COR_E_MISSINGMEMBER); } public MissingMemberException(String message) : base(message) { SetErrorCode(__HResults.COR_E_MISSINGMEMBER); } public MissingMemberException(String message, Exception inner) : base(message, inner) { SetErrorCode(__HResults.COR_E_MISSINGMEMBER); } protected MissingMemberException(SerializationInfo info, StreamingContext context) : base (info, context) { ClassName = (String)info.GetString("MMClassName"); MemberName = (String)info.GetString("MMMemberName"); Signature = (byte[])info.GetValue("MMSignature", typeof(byte[])); } public override String Message { get { if (ClassName == null) { return base.Message; } else { // do any desired fixups to classname here. return String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("MissingMember_Name", ClassName + "." + MemberName + (Signature != null ? " " + FormatSignature(Signature) : ""))); } } } // Called to format signature [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern String FormatSignature(byte [] signature); // Potentially called from the EE private MissingMemberException(String className, String memberName, byte[] signature) { ClassName = className; MemberName = memberName; Signature = signature; } public MissingMemberException(String className, String memberName) { ClassName = className; MemberName = memberName; } [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.SerializationFormatter)] public override void GetObjectData(SerializationInfo info, StreamingContext context) { if (info==null) { throw new ArgumentNullException("info"); } base.GetObjectData(info, context); info.AddValue("MMClassName", ClassName, typeof(String)); info.AddValue("MMMemberName", MemberName, typeof(String)); info.AddValue("MMSignature", Signature, typeof(byte[])); } // If ClassName != null, GetMessage will construct on the fly using it // and the other variables. This allows customization of the // format depending on the language environment. protected String ClassName; protected String MemberName; protected byte[] Signature; } } // 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
- TreeView.cs
- Opcode.cs
- XmlUtil.cs
- _WebProxyDataBuilder.cs
- Win32.cs
- MachineKeyValidationConverter.cs
- DesignTimeType.cs
- UdpDuplexChannel.cs
- ViewCellSlot.cs
- Transform3D.cs
- XmlTextReaderImpl.cs
- RegexNode.cs
- ConfigsHelper.cs
- ConfigurationConverterBase.cs
- Config.cs
- XpsResource.cs
- TextCharacters.cs
- UnSafeCharBuffer.cs
- Scripts.cs
- HttpResponseMessageProperty.cs
- Section.cs
- DesignerActionTextItem.cs
- AuthenticationManager.cs
- AdCreatedEventArgs.cs
- TreeChangeInfo.cs
- ListSortDescription.cs
- BinHexEncoding.cs
- FrameworkElementAutomationPeer.cs
- MappingSource.cs
- Wizard.cs
- DependsOnAttribute.cs
- TableLayoutPanelResizeGlyph.cs
- ResourceBinder.cs
- RelatedCurrencyManager.cs
- XmlTextReaderImpl.cs
- SecurityState.cs
- FormViewRow.cs
- ListParaClient.cs
- AlphabetConverter.cs
- SqlResolver.cs
- DrawingDrawingContext.cs
- ControlIdConverter.cs
- RadioButtonRenderer.cs
- ViewStateException.cs
- BrushConverter.cs
- CheckBox.cs
- _ContextAwareResult.cs
- PathFigure.cs
- UrlMappingCollection.cs
- _StreamFramer.cs
- TypefaceMap.cs
- HttpCacheVaryByContentEncodings.cs
- SqlDataSourceAdvancedOptionsForm.cs
- IntSecurity.cs
- WebBaseEventKeyComparer.cs
- XXXInfos.cs
- FixUpCollection.cs
- PostBackTrigger.cs
- FloaterParagraph.cs
- HTMLTextWriter.cs
- ObjectDataProvider.cs
- Registry.cs
- CustomLineCap.cs
- Lock.cs
- FormsAuthenticationEventArgs.cs
- ProcessModelInfo.cs
- AuthorizationRuleCollection.cs
- XmlObjectSerializerReadContext.cs
- HtmlEncodedRawTextWriter.cs
- ComponentResourceKeyConverter.cs
- EmulateRecognizeCompletedEventArgs.cs
- _LoggingObject.cs
- ResourceDictionaryCollection.cs
- FacetDescriptionElement.cs
- DesignerValidationSummaryAdapter.cs
- FlowDocumentView.cs
- XsltConvert.cs
- DynamicArgumentDesigner.xaml.cs
- FunctionNode.cs
- ResourceDictionary.cs
- OleDbRowUpdatingEvent.cs
- DescendantBaseQuery.cs
- XmlWriterDelegator.cs
- NaturalLanguageHyphenator.cs
- Trace.cs
- XmlLangPropertyAttribute.cs
- GridView.cs
- CodeVariableDeclarationStatement.cs
- MeasurementDCInfo.cs
- InstanceOwner.cs
- XPathAncestorIterator.cs
- CellParagraph.cs
- ZoneIdentityPermission.cs
- StorageScalarPropertyMapping.cs
- BamlTreeNode.cs
- CompilerLocalReference.cs
- StackOverflowException.cs
- TransformerTypeCollection.cs
- PerformanceCounterManager.cs
- RegexMatch.cs