Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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; } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RegexGroup.cs
- ModelItemDictionaryImpl.cs
- AsyncParams.cs
- CompilerState.cs
- ComponentManagerBroker.cs
- QueryOutputWriter.cs
- AnalyzedTree.cs
- Transactions.cs
- ToolStripGripRenderEventArgs.cs
- ScriptReference.cs
- PowerEase.cs
- TextLineBreak.cs
- DbConnectionPoolIdentity.cs
- CodeCastExpression.cs
- ExpandedWrapper.cs
- SqlHelper.cs
- HostTimeoutsElement.cs
- SqlTrackingService.cs
- XmlNode.cs
- SqlTriggerAttribute.cs
- SqlCrossApplyToCrossJoin.cs
- ClusterSafeNativeMethods.cs
- SHA384Managed.cs
- AppSettings.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- x509store.cs
- UnsafeNativeMethods.cs
- DeclaredTypeElementCollection.cs
- DependencyObjectValidator.cs
- _NegoState.cs
- SiteMapNodeItemEventArgs.cs
- PenThreadPool.cs
- ListBoxItemAutomationPeer.cs
- RouteTable.cs
- AuthenticatedStream.cs
- IdentityValidationException.cs
- TempEnvironment.cs
- ExtentJoinTreeNode.cs
- MembershipValidatePasswordEventArgs.cs
- IssuanceLicense.cs
- DynamicMethod.cs
- COM2IDispatchConverter.cs
- SystemGatewayIPAddressInformation.cs
- PolicyException.cs
- ZipIOLocalFileDataDescriptor.cs
- SchemaDeclBase.cs
- ScriptBehaviorDescriptor.cs
- TransactedBatchContext.cs
- DoubleKeyFrameCollection.cs
- EncryptedType.cs
- HostnameComparisonMode.cs
- OrderedDictionaryStateHelper.cs
- CompilationUnit.cs
- SoapSchemaExporter.cs
- x509store.cs
- SqlBinder.cs
- PropertyDescriptorComparer.cs
- Light.cs
- XmlSchemaObjectTable.cs
- EncoderBestFitFallback.cs
- FastEncoder.cs
- WeakKeyDictionary.cs
- WebPartTransformerAttribute.cs
- AttributeEmitter.cs
- CqlParserHelpers.cs
- StandardTransformFactory.cs
- IFlowDocumentViewer.cs
- TriggerBase.cs
- QueueException.cs
- MultitargetingHelpers.cs
- InvokeHandlers.cs
- MetadataItemCollectionFactory.cs
- DataGridCheckBoxColumn.cs
- SurrogateSelector.cs
- LinearQuaternionKeyFrame.cs
- DragStartedEventArgs.cs
- RegexCharClass.cs
- XPathBinder.cs
- EntityViewContainer.cs
- DataColumnCollection.cs
- DataSetViewSchema.cs
- BitmapImage.cs
- SiteMapNodeItem.cs
- SqlSupersetValidator.cs
- RemotingConfiguration.cs
- TextEndOfParagraph.cs
- BackgroundWorker.cs
- EntityStoreSchemaGenerator.cs
- ModelItem.cs
- HttpModuleAction.cs
- Rectangle.cs
- SpellerHighlightLayer.cs
- InputBinding.cs
- SecureUICommand.cs
- BreakRecordTable.cs
- PerformanceCounterCategory.cs
- HttpCachePolicyBase.cs
- PathFigureCollection.cs
- MailBnfHelper.cs
- NotCondition.cs