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
- EmptyEnumerator.cs
- DataRecord.cs
- shaperfactory.cs
- SubpageParagraph.cs
- ServiceModelExtensionCollectionElement.cs
- WebResourceUtil.cs
- CollectionEditor.cs
- ProviderConnectionPoint.cs
- objectquery_tresulttype.cs
- SafeUserTokenHandle.cs
- ClientTarget.cs
- ToolStripDropTargetManager.cs
- GZipUtils.cs
- Rethrow.cs
- DoWhileDesigner.xaml.cs
- UriExt.cs
- SqlFileStream.cs
- BamlMapTable.cs
- PropertyGroupDescription.cs
- HttpServerUtilityBase.cs
- CacheOutputQuery.cs
- CacheChildrenQuery.cs
- DynamicMetaObject.cs
- ReachFixedPageSerializer.cs
- EnumerableWrapperWeakToStrong.cs
- TextParagraphCache.cs
- InternalUserCancelledException.cs
- ListControl.cs
- SkinIDTypeConverter.cs
- VisualBrush.cs
- HWStack.cs
- XPathNodeHelper.cs
- GlobalDataBindingHandler.cs
- EmptyEnumerator.cs
- nulltextnavigator.cs
- CopyCodeAction.cs
- TemplateInstanceAttribute.cs
- CustomLineCap.cs
- ToolStripGripRenderEventArgs.cs
- DateTimeValueSerializerContext.cs
- FontFamily.cs
- MergePropertyDescriptor.cs
- AndMessageFilterTable.cs
- NodeFunctions.cs
- CLRBindingWorker.cs
- ComponentResourceManager.cs
- ImageSourceValueSerializer.cs
- CodeMemberEvent.cs
- TextRangeEditTables.cs
- WebServiceParameterData.cs
- WebPartDeleteVerb.cs
- SafeNativeMethods.cs
- SplitContainer.cs
- NativeMethods.cs
- SettingsBase.cs
- SoapSchemaMember.cs
- EvidenceBase.cs
- DBDataPermission.cs
- NamespaceEmitter.cs
- GeometryCollection.cs
- TextChange.cs
- RealizationContext.cs
- OdbcDataReader.cs
- JoinElimination.cs
- XPathAncestorIterator.cs
- _HelperAsyncResults.cs
- SoapObjectInfo.cs
- MenuAdapter.cs
- BitmapEffectrendercontext.cs
- Model3DGroup.cs
- BindingMemberInfo.cs
- UnsafeMethods.cs
- OdbcReferenceCollection.cs
- WorkflowRuntimeEndpoint.cs
- PassportIdentity.cs
- ProgressiveCrcCalculatingStream.cs
- OleDbStruct.cs
- DataGridViewControlCollection.cs
- StreamUpgradeBindingElement.cs
- AppDomain.cs
- DataGridViewRowStateChangedEventArgs.cs
- HtmlLink.cs
- ITextView.cs
- TypeRefElement.cs
- OracleFactory.cs
- BitmapEffectOutputConnector.cs
- AnnotationComponentChooser.cs
- IdentityModelStringsVersion1.cs
- FileDialogCustomPlace.cs
- PipelineModuleStepContainer.cs
- TableRowGroup.cs
- AttributeData.cs
- ListComponentEditor.cs
- ApplicationTrust.cs
- NegotiateStream.cs
- ObjectStorage.cs
- NotSupportedException.cs
- FrameworkContentElement.cs
- RIPEMD160.cs
- PageEventArgs.cs