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
- ActivityWithResultConverter.cs
- SQLBinary.cs
- LogicalExpressionTypeConverter.cs
- ListDictionaryInternal.cs
- Focus.cs
- SapiRecoInterop.cs
- SimpleWebHandlerParser.cs
- CustomActivityDesigner.cs
- RangeValuePattern.cs
- DataFormats.cs
- Process.cs
- OrCondition.cs
- WindowInteractionStateTracker.cs
- RawTextInputReport.cs
- Matrix3DConverter.cs
- DetailsViewDeleteEventArgs.cs
- GeneratedView.cs
- RuntimeArgumentHandle.cs
- ControlEvent.cs
- ProtocolImporter.cs
- MessageQueueTransaction.cs
- InkCanvasFeedbackAdorner.cs
- BooleanSwitch.cs
- SendingRequestEventArgs.cs
- SqlDataSourceFilteringEventArgs.cs
- compensatingcollection.cs
- AsyncResult.cs
- httpapplicationstate.cs
- EncodingInfo.cs
- WebScriptClientGenerator.cs
- SwitchElementsCollection.cs
- BuildProviderAppliesToAttribute.cs
- WMICapabilities.cs
- TransactionManager.cs
- PlatformCulture.cs
- DocumentationServerProtocol.cs
- ApplicationHost.cs
- BigInt.cs
- MailMessage.cs
- Rect3D.cs
- BaseCollection.cs
- HitTestParameters.cs
- basecomparevalidator.cs
- DataBindingCollection.cs
- HandlerBase.cs
- TransportDefaults.cs
- XamlFxTrace.cs
- Accessors.cs
- TreeViewDesigner.cs
- WindowsToolbarAsMenu.cs
- ImageInfo.cs
- UserPrincipalNameElement.cs
- Int32Animation.cs
- PartialCachingControl.cs
- InProcStateClientManager.cs
- ContainerParagraph.cs
- EditingMode.cs
- TabRenderer.cs
- TextParagraphView.cs
- EdmType.cs
- AVElementHelper.cs
- UnaryOperationBinder.cs
- ToolStripItemRenderEventArgs.cs
- CapacityStreamGeometryContext.cs
- ScriptingWebServicesSectionGroup.cs
- ToolStripItemEventArgs.cs
- TagMapInfo.cs
- WindowsStatic.cs
- SecurityResources.cs
- CapabilitiesState.cs
- ResponseStream.cs
- ResourceProviderFactory.cs
- WinFormsSecurity.cs
- XPathEmptyIterator.cs
- GenericFlowSwitchHelper.cs
- ResourceAttributes.cs
- StickyNote.cs
- WebCategoryAttribute.cs
- ObjectTypeMapping.cs
- dtdvalidator.cs
- EntityDataSourceDesigner.cs
- MetadataItemCollectionFactory.cs
- newinstructionaction.cs
- XmlObjectSerializerReadContextComplex.cs
- QueryCacheKey.cs
- WindowClosedEventArgs.cs
- QueryCursorEventArgs.cs
- ExitEventArgs.cs
- SourceChangedEventArgs.cs
- AdornedElementPlaceholder.cs
- SqlAggregateChecker.cs
- CacheSection.cs
- UniqueIdentifierService.cs
- PersonalizationDictionary.cs
- BitmapEffectCollection.cs
- FileAccessException.cs
- CollectionViewSource.cs
- WebUtil.cs
- ToolStripDropTargetManager.cs
- TagNameToTypeMapper.cs