Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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. // // ==--== //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // // 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ButtonAutomationPeer.cs
- XmlC14NWriter.cs
- CommandConverter.cs
- securitycriticaldataformultiplegetandset.cs
- SQLGuidStorage.cs
- TypeReference.cs
- XmlDataSourceView.cs
- ReachUIElementCollectionSerializerAsync.cs
- StylusCaptureWithinProperty.cs
- WebPartConnectionsCancelEventArgs.cs
- SerTrace.cs
- DataControlFieldCell.cs
- DependencyProperty.cs
- RawKeyboardInputReport.cs
- SizeKeyFrameCollection.cs
- TypeDependencyAttribute.cs
- VisualCollection.cs
- DataGridViewButtonCell.cs
- AssemblyInfo.cs
- XmlReader.cs
- PieceNameHelper.cs
- XmlDigitalSignatureProcessor.cs
- ImageListUtils.cs
- MessagePropertyDescriptionCollection.cs
- CompositeFontInfo.cs
- ObjectDataSourceMethodEditor.cs
- RoleServiceManager.cs
- StringConverter.cs
- RequestCache.cs
- JoinElimination.cs
- GridViewUpdatedEventArgs.cs
- OrthographicCamera.cs
- Propagator.cs
- NamedServiceModelExtensionCollectionElement.cs
- PageContentCollection.cs
- CompositeFontParser.cs
- PageClientProxyGenerator.cs
- ListMarkerSourceInfo.cs
- CodeConstructor.cs
- LineBreak.cs
- DataDocumentXPathNavigator.cs
- SessionIDManager.cs
- SortedList.cs
- EndpointBehaviorElementCollection.cs
- DateTimeConstantAttribute.cs
- ImageProxy.cs
- ProfileGroupSettingsCollection.cs
- Utilities.cs
- AsymmetricKeyExchangeDeformatter.cs
- DefaultAuthorizationContext.cs
- ComplexLine.cs
- HttpUnhandledOperationInvoker.cs
- _UriTypeConverter.cs
- COAUTHIDENTITY.cs
- altserialization.cs
- WindowsTitleBar.cs
- FtpCachePolicyElement.cs
- Int64Animation.cs
- DebugTrace.cs
- HostedElements.cs
- OdbcStatementHandle.cs
- TypeSource.cs
- TextLineBreak.cs
- TokenBasedSet.cs
- CustomPopupPlacement.cs
- XsdCachingReader.cs
- JapaneseCalendar.cs
- ExpressionEditorAttribute.cs
- FormViewDeleteEventArgs.cs
- ListParagraph.cs
- DirectoryObjectSecurity.cs
- GridViewCancelEditEventArgs.cs
- DataGridViewRowStateChangedEventArgs.cs
- PnrpPermission.cs
- PenContext.cs
- MembershipPasswordException.cs
- XmlQueryCardinality.cs
- ReadOnlyAttribute.cs
- DesignTable.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- wgx_sdk_version.cs
- EntityObject.cs
- DataServiceHostFactory.cs
- LocatorPart.cs
- ApplicationFileCodeDomTreeGenerator.cs
- SoapEnumAttribute.cs
- FrameworkRichTextComposition.cs
- Pair.cs
- PolyLineSegment.cs
- DataBinder.cs
- NullableConverter.cs
- AlternateViewCollection.cs
- SqlProviderManifest.cs
- BooleanExpr.cs
- FtpWebResponse.cs
- SizeValueSerializer.cs
- ExtensibleClassFactory.cs
- HiddenFieldPageStatePersister.cs
- HwndKeyboardInputProvider.cs
- VarInfo.cs