Code:
/ DotNET / DotNET / 8.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
- WaitHandleCannotBeOpenedException.cs
- Group.cs
- SessionStateContainer.cs
- ConfigurationConverterBase.cs
- XmlMapping.cs
- ProgressPage.cs
- Rectangle.cs
- ResourceKey.cs
- PassportIdentity.cs
- SimpleTypesSurrogate.cs
- TrackingExtract.cs
- StrokeCollectionConverter.cs
- AddToCollection.cs
- CreatingCookieEventArgs.cs
- OuterGlowBitmapEffect.cs
- HttpRawResponse.cs
- DataColumnSelectionConverter.cs
- CodeNamespaceImport.cs
- TextTreeDeleteContentUndoUnit.cs
- DecimalMinMaxAggregationOperator.cs
- ComplexTypeEmitter.cs
- DefaultValueTypeConverter.cs
- ProviderException.cs
- SizeConverter.cs
- EventLogPermissionAttribute.cs
- EntityDataSourceConfigureObjectContext.cs
- SchemaMapping.cs
- EmptyEnumerator.cs
- _DigestClient.cs
- GeneralTransformGroup.cs
- BuildProviderUtils.cs
- ForeignKeyConstraint.cs
- DataExpression.cs
- NativeActivityFaultContext.cs
- TreeBuilderXamlTranslator.cs
- ProcessHost.cs
- LineGeometry.cs
- RegexBoyerMoore.cs
- NativeRecognizer.cs
- CreateParams.cs
- SQLDecimal.cs
- ArgumentsParser.cs
- WebScriptMetadataFormatter.cs
- DesignOnlyAttribute.cs
- MemberAccessException.cs
- ToolStripDropDownMenu.cs
- GetPageNumberCompletedEventArgs.cs
- Buffer.cs
- HashMembershipCondition.cs
- OdbcError.cs
- MobileControlsSection.cs
- ItemCollection.cs
- ByteKeyFrameCollection.cs
- HtmlTable.cs
- FolderBrowserDialog.cs
- SqlCacheDependencySection.cs
- CheckBoxStandardAdapter.cs
- Label.cs
- Rect.cs
- EventLog.cs
- FormClosedEvent.cs
- TypeUnloadedException.cs
- ipaddressinformationcollection.cs
- SafeReversePInvokeHandle.cs
- InfiniteIntConverter.cs
- InternalResources.cs
- QilCloneVisitor.cs
- WebEncodingValidator.cs
- SocketPermission.cs
- TableAutomationPeer.cs
- BufferedReadStream.cs
- TabItemAutomationPeer.cs
- ValidatorAttribute.cs
- UnsafeNativeMethods.cs
- BindingContext.cs
- ThousandthOfEmRealPoints.cs
- BitmapScalingModeValidation.cs
- CheckBoxFlatAdapter.cs
- GridViewRowCollection.cs
- HtmlInputText.cs
- InteropExecutor.cs
- SessionStateSection.cs
- PathData.cs
- SoapParser.cs
- ColumnWidthChangedEvent.cs
- Vector3DCollectionValueSerializer.cs
- AppSettingsExpressionBuilder.cs
- ImageFormatConverter.cs
- SHA256Cng.cs
- Header.cs
- XPathDocumentBuilder.cs
- EmbossBitmapEffect.cs
- PresentationTraceSources.cs
- XmlText.cs
- SelectionChangedEventArgs.cs
- Errors.cs
- ObjectCacheHost.cs
- SystemIcmpV6Statistics.cs
- SqlDataSourceCache.cs
- DataGridCell.cs