Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Reflection / ReflectionTypeLoadException.cs / 1305376 / 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; using System.Diagnostics.Contracts; [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;} } [System.Security.SecurityCritical] // auto-generated_required public override void GetObjectData(SerializationInfo info, StreamingContext context) { if (info==null) { throw new ArgumentNullException("info"); } Contract.EndContractBlock(); 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ToolStripDropDownMenu.cs
- X509AsymmetricSecurityKey.cs
- GenericTypeParameterBuilder.cs
- LocatorGroup.cs
- DefaultDialogButtons.cs
- SafeSecurityHelper.cs
- PipeConnection.cs
- SiteMapPath.cs
- Thumb.cs
- DiscoveryDocumentLinksPattern.cs
- TextFormatter.cs
- ToolBarButtonDesigner.cs
- EventDrivenDesigner.cs
- PasswordDeriveBytes.cs
- SQLDateTimeStorage.cs
- EFColumnProvider.cs
- SerializationObjectManager.cs
- PropertyGridCommands.cs
- EntityTransaction.cs
- ObjectIDGenerator.cs
- WorkflowWebHostingModule.cs
- PropertyPathConverter.cs
- WindowAutomationPeer.cs
- ListSourceHelper.cs
- HttpHandlerAction.cs
- AuthenticationModulesSection.cs
- PassportAuthenticationEventArgs.cs
- SpeechUI.cs
- WebPartZoneBase.cs
- BuildResultCache.cs
- UrlPath.cs
- PropertyManager.cs
- MemberRestriction.cs
- RequestCachingSection.cs
- DashStyles.cs
- SQLMoney.cs
- DropTarget.cs
- SQlBooleanStorage.cs
- _IPv4Address.cs
- TransformCryptoHandle.cs
- NullableLongAverageAggregationOperator.cs
- SmtpClient.cs
- GridViewPageEventArgs.cs
- SettingsPropertyValue.cs
- RepeatButton.cs
- StorageComplexTypeMapping.cs
- ListViewCommandEventArgs.cs
- StringUtil.cs
- AsyncStreamReader.cs
- Html32TextWriter.cs
- SchemaObjectWriter.cs
- StrongNameIdentityPermission.cs
- MergePropertyDescriptor.cs
- SqlInternalConnectionTds.cs
- InkSerializer.cs
- DomainConstraint.cs
- COM2Enum.cs
- PerfCounterSection.cs
- DocumentSequenceHighlightLayer.cs
- DataSourceCacheDurationConverter.cs
- webbrowsersite.cs
- BCryptSafeHandles.cs
- DataGridTextBox.cs
- BaseAppDomainProtocolHandler.cs
- SHA1.cs
- GeometryHitTestParameters.cs
- UnicodeEncoding.cs
- Soap12ProtocolImporter.cs
- DesignerMetadata.cs
- srgsitem.cs
- TextRenderer.cs
- SqlBuilder.cs
- InternalDuplexChannelFactory.cs
- HttpListenerPrefixCollection.cs
- SortQuery.cs
- CacheDict.cs
- COMException.cs
- DataGridViewHeaderCell.cs
- Font.cs
- TextRunTypographyProperties.cs
- DrawingCollection.cs
- FixedSOMSemanticBox.cs
- GatewayDefinition.cs
- AssemblyNameUtility.cs
- SafeCryptHandles.cs
- TemplateControlBuildProvider.cs
- CaseInsensitiveOrdinalStringComparer.cs
- UiaCoreProviderApi.cs
- ScriptComponentDescriptor.cs
- storagemappingitemcollection.viewdictionary.cs
- PathFigureCollection.cs
- WebDisplayNameAttribute.cs
- IndentTextWriter.cs
- ValidationUtility.cs
- SpellerInterop.cs
- FileUpload.cs
- NativeMethods.cs
- CompilerParameters.cs
- Solver.cs
- ellipse.cs