Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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[])); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Pair.cs
- ProgressChangedEventArgs.cs
- SwitchElementsCollection.cs
- KeyValueInternalCollection.cs
- ResponseBodyWriter.cs
- FileUtil.cs
- LogArchiveSnapshot.cs
- ServerValidateEventArgs.cs
- SimpleMailWebEventProvider.cs
- EventRoute.cs
- BasicHttpSecurityElement.cs
- DrawingState.cs
- RequestCacheEntry.cs
- _Win32.cs
- Composition.cs
- ColorAnimation.cs
- DataError.cs
- ObjectIDGenerator.cs
- XmlMembersMapping.cs
- ValueQuery.cs
- RoutedCommand.cs
- LZCodec.cs
- UseAttributeSetsAction.cs
- RulePatternOps.cs
- FilterableAttribute.cs
- OletxEnlistment.cs
- ImageButton.cs
- HMACRIPEMD160.cs
- NetworkStream.cs
- AuthenticateEventArgs.cs
- Stack.cs
- PixelShader.cs
- Collection.cs
- IdentityHolder.cs
- AVElementHelper.cs
- ContentDisposition.cs
- Style.cs
- CounterSample.cs
- ListSortDescription.cs
- RenderContext.cs
- WebBrowserPermission.cs
- FactoryGenerator.cs
- BigInt.cs
- DoubleMinMaxAggregationOperator.cs
- TextSelection.cs
- EventLogEntry.cs
- FreeFormPanel.cs
- FileLoadException.cs
- ValidationResult.cs
- DurableInstanceManager.cs
- StackOverflowException.cs
- PageParser.cs
- DataBindingHandlerAttribute.cs
- AnnotationComponentChooser.cs
- OutputCacheProfileCollection.cs
- FormsAuthenticationUserCollection.cs
- ListViewUpdatedEventArgs.cs
- QueryContinueDragEventArgs.cs
- DSACryptoServiceProvider.cs
- ParameterCollection.cs
- ProfileSection.cs
- ProfileSettingsCollection.cs
- WebOperationContext.cs
- ReadOnlyDataSource.cs
- ParagraphResult.cs
- InteropBitmapSource.cs
- MouseCaptureWithinProperty.cs
- Events.cs
- XmlAttributes.cs
- TextServicesLoader.cs
- XmlSchemaType.cs
- HebrewCalendar.cs
- MSAAWinEventWrap.cs
- Operators.cs
- DbConnectionClosed.cs
- CompilationLock.cs
- SchemaObjectWriter.cs
- FormattedTextSymbols.cs
- SplitContainerDesigner.cs
- AddingNewEventArgs.cs
- WrappedIUnknown.cs
- FixUp.cs
- WebHttpSecurityModeHelper.cs
- Int16Storage.cs
- AuthenticationService.cs
- safelink.cs
- LineGeometry.cs
- PcmConverter.cs
- TypeLoadException.cs
- ExpressionList.cs
- HttpHandlerAction.cs
- SpellerError.cs
- OdbcCommand.cs
- FrameworkElementAutomationPeer.cs
- DataBoundControlHelper.cs
- ThreadStaticAttribute.cs
- DbConnectionPoolIdentity.cs
- CAGDesigner.cs
- StrokeSerializer.cs
- StreamUpgradeProvider.cs