Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / Reflection / ReflectionTypeLoadException.cs / 1 / ReflectionTypeLoadException.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // // ReflectionTypeLoadException is thrown when multiple TypeLoadExceptions may occur. // Specifically, when you call Module.GetTypes() this causes multiple class loads to occur. // If there are failures, we continue to load classes and build an array of the successfully // loaded classes. We also build an array of the errors that occur. Then we throw this exception // which exposes both the array of classes and the array of TypeLoadExceptions. // // // // namespace System.Reflection { using System; using System.Runtime.Serialization; using System.Security.Permissions; [Serializable()] [System.Runtime.InteropServices.ComVisible(true)] public sealed class ReflectionTypeLoadException : SystemException, ISerializable { private Type[] _classes; private Exception[] _exceptions; // private constructor. This is not called. private ReflectionTypeLoadException() : base(Environment.GetResourceString("ReflectionTypeLoad_LoadFailed")) { SetErrorCode(__HResults.COR_E_REFLECTIONTYPELOAD); } // private constructor. This is called from inside the runtime. private ReflectionTypeLoadException(String message) : base(message) { SetErrorCode(__HResults.COR_E_REFLECTIONTYPELOAD); } public ReflectionTypeLoadException(Type[] classes, Exception[] exceptions) : base(null) { _classes = classes; _exceptions = exceptions; SetErrorCode(__HResults.COR_E_REFLECTIONTYPELOAD); } public ReflectionTypeLoadException(Type[] classes, Exception[] exceptions, String message) : base(message) { _classes = classes; _exceptions = exceptions; SetErrorCode(__HResults.COR_E_REFLECTIONTYPELOAD); } internal ReflectionTypeLoadException(SerializationInfo info, StreamingContext context) : base (info, context) { _classes = (Type[])(info.GetValue("Types", typeof(Type[]))); _exceptions = (Exception[])(info.GetValue("Exceptions", typeof(Exception[]))); } public Type[] Types { get {return _classes;} } public Exception[] LoaderExceptions { get {return _exceptions;} } [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("Types", _classes, typeof(Type[])); info.AddValue("Exceptions", _exceptions, typeof(Exception[])); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SelectionChangedEventArgs.cs
- WebRequest.cs
- TargetConverter.cs
- PhysicalFontFamily.cs
- RectangleF.cs
- AssemblyAssociatedContentFileAttribute.cs
- SecurityHelper.cs
- XPathAncestorQuery.cs
- BuildProvider.cs
- OracleRowUpdatingEventArgs.cs
- EdmToObjectNamespaceMap.cs
- StringComparer.cs
- EntityDataSourceDataSelection.cs
- FontCacheLogic.cs
- StringCollection.cs
- CapiNative.cs
- ItemsControl.cs
- XmlSchemaAttributeGroupRef.cs
- ThicknessAnimationBase.cs
- DataQuery.cs
- ClickablePoint.cs
- SlotInfo.cs
- LicenseManager.cs
- MediaCommands.cs
- FloaterBaseParaClient.cs
- NegotiationTokenAuthenticatorState.cs
- DataListItemEventArgs.cs
- ItemsPanelTemplate.cs
- FixedSOMContainer.cs
- AddInControllerImpl.cs
- webeventbuffer.cs
- SHA1.cs
- OutputCacheSection.cs
- DataGridPageChangedEventArgs.cs
- WindowsFormsEditorServiceHelper.cs
- Line.cs
- WebPartConnectVerb.cs
- CFGGrammar.cs
- IDictionary.cs
- DecimalSumAggregationOperator.cs
- ScrollProperties.cs
- EventMappingSettings.cs
- PasswordBox.cs
- PartialTrustVisibleAssembly.cs
- TextEditorTyping.cs
- SafeMILHandleMemoryPressure.cs
- ExpressionEvaluator.cs
- EmptyControlCollection.cs
- AtomEntry.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- DataGrid.cs
- Stack.cs
- SelectionHighlightInfo.cs
- XPathSingletonIterator.cs
- Effect.cs
- SourceInterpreter.cs
- FixedSOMPageConstructor.cs
- InputElement.cs
- FixedSOMLineCollection.cs
- ScrollBarAutomationPeer.cs
- DefaultBinder.cs
- CryptoStream.cs
- WindowsRebar.cs
- BrowserCapabilitiesFactory.cs
- LabelEditEvent.cs
- QuadTree.cs
- DictionaryEntry.cs
- X509CertificateTrustedIssuerElement.cs
- MSHTMLHostUtil.cs
- ZeroOpNode.cs
- DelegatingConfigHost.cs
- EarlyBoundInfo.cs
- EncoderParameter.cs
- DataReceivedEventArgs.cs
- RegistryKey.cs
- _NegoStream.cs
- PointAnimationUsingPath.cs
- XhtmlTextWriter.cs
- CodeGen.cs
- unsafeIndexingFilterStream.cs
- ConfigsHelper.cs
- CommandSet.cs
- EntityDescriptor.cs
- DataGridViewUtilities.cs
- ColorBlend.cs
- AudioFormatConverter.cs
- TaiwanLunisolarCalendar.cs
- LazyTextWriterCreator.cs
- SmiGettersStream.cs
- HttpStaticObjectsCollectionBase.cs
- Win32MouseDevice.cs
- HwndMouseInputProvider.cs
- HttpRawResponse.cs
- ListBase.cs
- AttachInfo.cs
- MultiView.cs
- TargetException.cs
- DocComment.cs
- DataTrigger.cs
- SqlDataSourceView.cs