Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- SqlUtil.cs
- HtmlGenericControl.cs
- EnumMemberAttribute.cs
- SimpleMailWebEventProvider.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- MatrixConverter.cs
- BitSet.cs
- XhtmlBasicListAdapter.cs
- CryptoProvider.cs
- SchemaElementDecl.cs
- safesecurityhelperavalon.cs
- XPathNodePointer.cs
- SaveFileDialogDesigner.cs
- ButtonPopupAdapter.cs
- OperandQuery.cs
- TextBox.cs
- SystemDiagnosticsSection.cs
- DetailsViewRow.cs
- RelationshipEntry.cs
- DynamicPropertyHolder.cs
- sitestring.cs
- ParagraphResult.cs
- OverlappedAsyncResult.cs
- DockAndAnchorLayout.cs
- objectquery_tresulttype.cs
- DateTimeValueSerializer.cs
- DataGridViewColumnStateChangedEventArgs.cs
- ObjectDataSource.cs
- SystemFonts.cs
- BitmapCodecInfo.cs
- WebPartConnectionsEventArgs.cs
- DataControlCommands.cs
- UnsafeNativeMethods.cs
- NamespaceEmitter.cs
- DataControlField.cs
- LambdaValue.cs
- ConfigurationValues.cs
- DoubleLinkList.cs
- DynamicDataRoute.cs
- DictionaryGlobals.cs
- Encoder.cs
- DesignerObjectListAdapter.cs
- FormsIdentity.cs
- RunClient.cs
- BookmarkOptionsHelper.cs
- CompilerErrorCollection.cs
- CurrentTimeZone.cs
- EncryptedData.cs
- Rectangle.cs
- FormatStringEditor.cs
- DataColumn.cs
- ControlValuePropertyAttribute.cs
- SQLInt64Storage.cs
- Baml2006SchemaContext.cs
- RSAOAEPKeyExchangeDeformatter.cs
- XmlSerializableReader.cs
- EditorZoneBase.cs
- Logging.cs
- DesignerVerb.cs
- TextRunCache.cs
- SignatureDescription.cs
- QilLoop.cs
- CompoundFileDeflateTransform.cs
- ClientUtils.cs
- PropertyTabChangedEvent.cs
- SplitContainer.cs
- DataGridViewRowHeaderCell.cs
- PointKeyFrameCollection.cs
- SQLDoubleStorage.cs
- PlacementWorkspace.cs
- RowCache.cs
- DataObjectEventArgs.cs
- NameTable.cs
- WebPartManagerInternals.cs
- EventNotify.cs
- DataTableReaderListener.cs
- HwndHost.cs
- XmlSchemaExporter.cs
- SafeLocalAllocation.cs
- XPathSelfQuery.cs
- PaintValueEventArgs.cs
- TypeDescriptionProviderAttribute.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- DrawingState.cs
- Pool.cs
- NameScopePropertyAttribute.cs
- QuaternionConverter.cs
- TextTrailingWordEllipsis.cs
- DesignObjectWrapper.cs
- OleDbConnectionFactory.cs
- WindowsRebar.cs
- ReferenceEqualityComparer.cs
- MergePropertyDescriptor.cs
- GlyphsSerializer.cs
- InlineCollection.cs
- WsatServiceCertificate.cs
- CodeAttributeArgumentCollection.cs
- RecommendedAsConfigurableAttribute.cs
- ToRequest.cs
- ScrollProviderWrapper.cs