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
- VisualBrush.cs
- WindowsTokenRoleProvider.cs
- ImportContext.cs
- FormsAuthenticationEventArgs.cs
- DetailsViewAutoFormat.cs
- HyperLink.cs
- RelationshipEndCollection.cs
- DataControlField.cs
- ExpressionEditorSheet.cs
- Zone.cs
- HyperLinkColumn.cs
- hwndwrapper.cs
- PartitionResolver.cs
- Property.cs
- SqlConnectionFactory.cs
- PageClientProxyGenerator.cs
- SafeMILHandle.cs
- DictionaryBase.cs
- ScriptModule.cs
- WebPartsPersonalization.cs
- WeakHashtable.cs
- XsltArgumentList.cs
- SoapDocumentServiceAttribute.cs
- odbcmetadatafactory.cs
- CommonObjectSecurity.cs
- Msec.cs
- ValidationErrorCollection.cs
- SqlSelectClauseBuilder.cs
- DataGridCellsPresenter.cs
- ActiveXSite.cs
- DCSafeHandle.cs
- ADRole.cs
- TdsRecordBufferSetter.cs
- ListViewItemEventArgs.cs
- DependencyStoreSurrogate.cs
- StubHelpers.cs
- SecurityToken.cs
- CqlQuery.cs
- MultipartContentParser.cs
- DataKeyArray.cs
- DrawingContext.cs
- LocalizableResourceBuilder.cs
- SettingsAttributes.cs
- NameSpaceEvent.cs
- DocumentGridContextMenu.cs
- IgnorePropertiesAttribute.cs
- IriParsingElement.cs
- InkCanvasInnerCanvas.cs
- ItemAutomationPeer.cs
- ActivityValidator.cs
- SecurityElement.cs
- DataViewSetting.cs
- CommandLineParser.cs
- FloaterParaClient.cs
- Utils.cs
- SQLBytesStorage.cs
- ImageCodecInfoPrivate.cs
- SQLInt32Storage.cs
- StringUtil.cs
- WebPartCatalogCloseVerb.cs
- DataKeyCollection.cs
- COAUTHINFO.cs
- PieceNameHelper.cs
- SafeViewOfFileHandle.cs
- RIPEMD160Managed.cs
- DataPagerFieldCollection.cs
- DataGridDesigner.cs
- DynamicRenderer.cs
- LocationUpdates.cs
- QueryLifecycle.cs
- XPathParser.cs
- Column.cs
- RandomNumberGenerator.cs
- ResourceBinder.cs
- FlowDocumentPageViewerAutomationPeer.cs
- CertificateManager.cs
- InputElement.cs
- BooleanExpr.cs
- ProfileSettingsCollection.cs
- AppDomainUnloadedException.cs
- CustomLineCap.cs
- LinkLabel.cs
- WhitespaceRule.cs
- SQLByte.cs
- NoResizeHandleGlyph.cs
- BasicExpressionVisitor.cs
- FixedDocumentSequencePaginator.cs
- ElapsedEventArgs.cs
- ProviderIncompatibleException.cs
- RowType.cs
- EditorZone.cs
- CancellationHandler.cs
- LeftCellWrapper.cs
- NativeRecognizer.cs
- RegexMatchCollection.cs
- Module.cs
- GenerateTemporaryTargetAssembly.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- LoginDesigner.cs
- Evidence.cs