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
- PerfCounters.cs
- DataGridViewBindingCompleteEventArgs.cs
- RandomNumberGenerator.cs
- Point3DCollectionConverter.cs
- XPathQilFactory.cs
- EntityDesignerDataSourceView.cs
- DetailsViewUpdatedEventArgs.cs
- ViewGenerator.cs
- RadioButtonFlatAdapter.cs
- SerializerDescriptor.cs
- ObjectIDGenerator.cs
- NativeMethods.cs
- TemplateColumn.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- RefreshResponseInfo.cs
- AssociationType.cs
- ArgumentException.cs
- EntityWrapperFactory.cs
- CodePageUtils.cs
- XsltQilFactory.cs
- DataGridViewCheckBoxColumn.cs
- DesignerActionPanel.cs
- Columns.cs
- CodeObject.cs
- FileEnumerator.cs
- MenuItemBinding.cs
- RelationalExpressions.cs
- ValueUnavailableException.cs
- DetailsViewInsertEventArgs.cs
- DataFormat.cs
- NativeMethods.cs
- Stroke2.cs
- PageWrapper.cs
- SiteOfOriginContainer.cs
- ArithmeticException.cs
- Matrix3D.cs
- NameValueCollection.cs
- BindingNavigator.cs
- DeferredReference.cs
- GridViewColumnCollectionChangedEventArgs.cs
- OLEDB_Enum.cs
- BuildResultCache.cs
- MouseGestureValueSerializer.cs
- AdapterDictionary.cs
- HttpCookiesSection.cs
- SafeTokenHandle.cs
- HttpRequestCacheValidator.cs
- EventLogHandle.cs
- DataControlCommands.cs
- TextFormatter.cs
- DrawListViewSubItemEventArgs.cs
- MachineKeySection.cs
- ConcurrentBag.cs
- SiteMapDesignerDataSourceView.cs
- DeflateEmulationStream.cs
- TextServicesPropertyRanges.cs
- CriticalFileToken.cs
- XmlArrayItemAttributes.cs
- TreeNodeBinding.cs
- EntitySqlQueryCacheKey.cs
- TextPointer.cs
- ComponentDispatcher.cs
- URLMembershipCondition.cs
- XmlArrayItemAttribute.cs
- Inline.cs
- ExpressionSelection.cs
- AnimationClockResource.cs
- NativeRecognizer.cs
- TreeViewAutomationPeer.cs
- ItemContainerGenerator.cs
- EmptyCollection.cs
- DropDownList.cs
- HttpContext.cs
- TypeValidationEventArgs.cs
- XmlChildNodes.cs
- BaseHashHelper.cs
- ToolStripSplitStackLayout.cs
- XPathDocumentIterator.cs
- MetadataCache.cs
- XmlCDATASection.cs
- ConnectionPoint.cs
- HttpModulesSection.cs
- SkewTransform.cs
- ArgumentDirectionHelper.cs
- UmAlQuraCalendar.cs
- DataRecordInternal.cs
- WorkflowValidationFailedException.cs
- EpmContentSerializer.cs
- ApplicationDirectoryMembershipCondition.cs
- TreeWalker.cs
- ErrorView.xaml.cs
- SafeArrayRankMismatchException.cs
- MatrixValueSerializer.cs
- DescendentsWalkerBase.cs
- ExpressionWriter.cs
- GPPOINTF.cs
- Invariant.cs
- CustomValidator.cs
- IndexingContentUnit.cs
- CryptoProvider.cs