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
- OSEnvironmentHelper.cs
- TextElementEnumerator.cs
- ParameterBuilder.cs
- DrawItemEvent.cs
- Walker.cs
- WebPartConnection.cs
- SmtpException.cs
- DataColumnPropertyDescriptor.cs
- ImmutableAssemblyCacheEntry.cs
- DataRecordInternal.cs
- RoleService.cs
- StoragePropertyMapping.cs
- AsymmetricSignatureDeformatter.cs
- HTTPNotFoundHandler.cs
- ConnectionStringSettings.cs
- DescendantOverDescendantQuery.cs
- ElementInit.cs
- _Rfc2616CacheValidators.cs
- RelationshipFixer.cs
- XmlMembersMapping.cs
- ReaderWriterLockWrapper.cs
- EntityExpressionVisitor.cs
- DocumentPageTextView.cs
- MessagingDescriptionAttribute.cs
- RegexRunnerFactory.cs
- OleDbErrorCollection.cs
- DetailsViewInsertEventArgs.cs
- DoubleCollectionValueSerializer.cs
- WebContext.cs
- XPathScanner.cs
- TypeConverterAttribute.cs
- XmlSchemaParticle.cs
- CharacterMetricsDictionary.cs
- TextElement.cs
- RuleSettings.cs
- SocketElement.cs
- AtomParser.cs
- HttpConfigurationContext.cs
- SearchForVirtualItemEventArgs.cs
- mediaeventargs.cs
- XmlAttributeProperties.cs
- ConnectionOrientedTransportBindingElement.cs
- AdjustableArrowCap.cs
- Ticks.cs
- ServiceRouteHandler.cs
- PersonalizationProviderHelper.cs
- WebPartEditorCancelVerb.cs
- DES.cs
- RenderDataDrawingContext.cs
- AdCreatedEventArgs.cs
- SchemaHelper.cs
- AssemblyBuilder.cs
- PlainXmlSerializer.cs
- StringAnimationUsingKeyFrames.cs
- SerializableAttribute.cs
- ActivationArguments.cs
- GPStream.cs
- NamedObject.cs
- Asn1Utilities.cs
- ClientProxyGenerator.cs
- Point3DKeyFrameCollection.cs
- SafeArrayRankMismatchException.cs
- ColumnHeaderConverter.cs
- TableProvider.cs
- SamlAuthenticationStatement.cs
- ExclusiveCanonicalizationTransform.cs
- HorizontalAlignConverter.cs
- ConfigurationLockCollection.cs
- SyntaxCheck.cs
- WizardForm.cs
- ViewKeyConstraint.cs
- ElementFactory.cs
- StreamGeometry.cs
- NavigationPropertyAccessor.cs
- SqlGenericUtil.cs
- ProgressBarAutomationPeer.cs
- RegexStringValidatorAttribute.cs
- OpenTypeLayoutCache.cs
- CodeFieldReferenceExpression.cs
- DocComment.cs
- HitTestResult.cs
- PropertyEmitter.cs
- DataExpression.cs
- GridViewCommandEventArgs.cs
- ObjectNavigationPropertyMapping.cs
- Crc32.cs
- ChannelBinding.cs
- WebHttpElement.cs
- LambdaCompiler.Unary.cs
- CompilationRelaxations.cs
- DataGridViewElement.cs
- ClientType.cs
- QilInvoke.cs
- EmbeddedObject.cs
- HwndHostAutomationPeer.cs
- StringUtil.cs
- XmlBinaryReaderSession.cs
- FormClosedEvent.cs
- ConnectionOrientedTransportBindingElement.cs
- TabItemAutomationPeer.cs