Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- VariableBinder.cs
- OdbcConnectionString.cs
- BooleanConverter.cs
- Int32CAMarshaler.cs
- BuiltInPermissionSets.cs
- Pair.cs
- HtmlElementEventArgs.cs
- DetailsViewRowCollection.cs
- ConfigurationSchemaErrors.cs
- Operand.cs
- UserUseLicenseDictionaryLoader.cs
- TextRangeAdaptor.cs
- BaseServiceProvider.cs
- Config.cs
- SqlBooleanMismatchVisitor.cs
- CompositeActivityTypeDescriptorProvider.cs
- TreeNodeStyle.cs
- XsdDuration.cs
- StateManagedCollection.cs
- XmlAutoDetectWriter.cs
- SocketStream.cs
- InputElement.cs
- LoginUtil.cs
- XmlSchemaExternal.cs
- Converter.cs
- MsdtcWrapper.cs
- PageThemeParser.cs
- GZipDecoder.cs
- WindowsRegion.cs
- TemplateParser.cs
- RSACryptoServiceProvider.cs
- HttpRuntimeSection.cs
- ClientSettingsProvider.cs
- NamedPipeProcessProtocolHandler.cs
- HealthMonitoringSectionHelper.cs
- Compensation.cs
- LayeredChannelFactory.cs
- SelectionProviderWrapper.cs
- MenuItemBindingCollection.cs
- HyperLinkColumn.cs
- DbgUtil.cs
- DbDataAdapter.cs
- ObjectList.cs
- SamlAttribute.cs
- AssociationTypeEmitter.cs
- MethodBuilder.cs
- sapiproxy.cs
- SystemInfo.cs
- RuleSetBrowserDialog.cs
- UnionCqlBlock.cs
- _WinHttpWebProxyDataBuilder.cs
- HttpException.cs
- FormConverter.cs
- XmlSerializationReader.cs
- CompositeActivityDesigner.cs
- RtfToken.cs
- CellLabel.cs
- GiveFeedbackEvent.cs
- FileUpload.cs
- TagNameToTypeMapper.cs
- CssStyleCollection.cs
- RegexCompilationInfo.cs
- AddInAttribute.cs
- DataServices.cs
- documentsequencetextcontainer.cs
- InternalException.cs
- WorkflowPrinting.cs
- SID.cs
- WebServiceHost.cs
- IConvertible.cs
- ObjectCacheSettings.cs
- Typography.cs
- DesigntimeLicenseContext.cs
- FindResponse.cs
- LinkUtilities.cs
- WebSysDescriptionAttribute.cs
- MarshalByRefObject.cs
- WorkflowPrinting.cs
- METAHEADER.cs
- TimeSpanValidator.cs
- BitmapEffectRenderDataResource.cs
- WebBrowserUriTypeConverter.cs
- FrugalList.cs
- DataTableReaderListener.cs
- ToolStripComboBox.cs
- RectKeyFrameCollection.cs
- PageThemeParser.cs
- SmtpReplyReaderFactory.cs
- ToolStripArrowRenderEventArgs.cs
- DataGridTemplateColumn.cs
- ImageIndexConverter.cs
- DataGridAutoFormat.cs
- DialogResultConverter.cs
- AssociatedControlConverter.cs
- EntityAdapter.cs
- FlowLayout.cs
- TableStyle.cs
- GroupBoxAutomationPeer.cs
- SoapClientMessage.cs
- TokenizerHelper.cs