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
- datacache.cs
- JsonStringDataContract.cs
- OutputScopeManager.cs
- MouseEvent.cs
- ExtenderControl.cs
- _SslStream.cs
- DataStreamFromComStream.cs
- NetworkCredential.cs
- XmlAggregates.cs
- GenericTextProperties.cs
- Menu.cs
- TrackingMemoryStream.cs
- SqlCacheDependencyDatabaseCollection.cs
- ThemeDictionaryExtension.cs
- MissingMethodException.cs
- PageThemeParser.cs
- InkCanvasSelectionAdorner.cs
- MsmqIntegrationReceiveParameters.cs
- WebPartsPersonalizationAuthorization.cs
- CompositeClientFormatter.cs
- EmissiveMaterial.cs
- UshortList2.cs
- webeventbuffer.cs
- TagMapInfo.cs
- WorkflowApplicationException.cs
- PropertyGrid.cs
- ManagementObjectSearcher.cs
- DbReferenceCollection.cs
- SoapSchemaExporter.cs
- DebugHandleTracker.cs
- SlipBehavior.cs
- TextBox.cs
- WorkflowQueue.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- InputLanguage.cs
- NullableFloatMinMaxAggregationOperator.cs
- Globals.cs
- IncrementalCompileAnalyzer.cs
- COAUTHINFO.cs
- ToolStripComboBox.cs
- HtmlInputReset.cs
- PermissionSetTriple.cs
- EditCommandColumn.cs
- PasswordDeriveBytes.cs
- MethodBuilderInstantiation.cs
- InkCanvasAutomationPeer.cs
- NavigationProperty.cs
- HebrewNumber.cs
- CurrentChangingEventArgs.cs
- XmlTextReader.cs
- StorageAssociationSetMapping.cs
- Roles.cs
- SchemaNamespaceManager.cs
- GeneralTransform2DTo3D.cs
- HttpStreams.cs
- HealthMonitoringSectionHelper.cs
- SerializationInfo.cs
- DefaultSection.cs
- StructuralCache.cs
- StringStorage.cs
- XMLDiffLoader.cs
- InputDevice.cs
- AssociationSet.cs
- Normalization.cs
- MissingMemberException.cs
- WebPartHelpVerb.cs
- ellipse.cs
- EdmValidator.cs
- PermissionRequestEvidence.cs
- QilInvokeEarlyBound.cs
- SafeFileMappingHandle.cs
- XmlILAnnotation.cs
- MobileFormsAuthentication.cs
- ServiceModelEnumValidatorAttribute.cs
- FlowDocumentFormatter.cs
- NativeCompoundFileAPIs.cs
- QfeChecker.cs
- CodeTypeConstructor.cs
- TextRangeEdit.cs
- MessageFilterTable.cs
- ParserHooks.cs
- ZipIOCentralDirectoryFileHeader.cs
- MetaDataInfo.cs
- StatusBar.cs
- AuditLogLocation.cs
- DocumentGridPage.cs
- PostBackTrigger.cs
- CharEnumerator.cs
- ClientTarget.cs
- DataGridLinkButton.cs
- HijriCalendar.cs
- UpdateProgress.cs
- Pkcs9Attribute.cs
- ComponentCommands.cs
- IFlowDocumentViewer.cs
- LabelDesigner.cs
- LinkedResourceCollection.cs
- XamlToRtfWriter.cs
- FrugalList.cs
- ModelUIElement3D.cs