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
- SecurityContext.cs
- OleDbConnectionInternal.cs
- MailWriter.cs
- ConstrainedDataObject.cs
- mactripleDES.cs
- XmlCDATASection.cs
- SqlAggregateChecker.cs
- DBBindings.cs
- KeyPressEvent.cs
- DesignerForm.cs
- PartialClassGenerationTaskInternal.cs
- UnmanagedMemoryStream.cs
- Subtree.cs
- ArraySegment.cs
- ListViewUpdatedEventArgs.cs
- GridProviderWrapper.cs
- parserscommon.cs
- Debug.cs
- XmlWrappingWriter.cs
- WindowsPrincipal.cs
- SiteMapNodeCollection.cs
- SchemaElementDecl.cs
- ADMembershipUser.cs
- ValidateNames.cs
- DataGridBoolColumn.cs
- FirstQueryOperator.cs
- OleDbReferenceCollection.cs
- TypeLoadException.cs
- OrderedEnumerableRowCollection.cs
- HierarchicalDataBoundControl.cs
- Menu.cs
- OleDbCommand.cs
- WebPartConnectVerb.cs
- XmlLanguageConverter.cs
- Native.cs
- TextChange.cs
- FixedTextBuilder.cs
- Comparer.cs
- ResourceDictionaryCollection.cs
- VirtualPath.cs
- HtmlCommandAdapter.cs
- MobileControlPersister.cs
- CodeSnippetExpression.cs
- GeometryHitTestParameters.cs
- DependencyObject.cs
- PageResolution.cs
- NumericUpDownAccelerationCollection.cs
- ObjectSecurity.cs
- BindingValueChangedEventArgs.cs
- HtmlShimManager.cs
- SQLSingleStorage.cs
- ValueChangedEventManager.cs
- DragEvent.cs
- PrivilegedConfigurationManager.cs
- MsmqIntegrationValidationBehavior.cs
- InkCanvasFeedbackAdorner.cs
- ProtectedConfigurationProviderCollection.cs
- ImageBrush.cs
- DurationConverter.cs
- XamlToRtfWriter.cs
- ServiceModelSectionGroup.cs
- Axis.cs
- CheckableControlBaseAdapter.cs
- MappingSource.cs
- ExpressionEditorAttribute.cs
- EdmTypeAttribute.cs
- safePerfProviderHandle.cs
- DefaultClaimSet.cs
- InvalidOperationException.cs
- ContainerControl.cs
- SafeNativeMethods.cs
- DataGridViewControlCollection.cs
- SqlUdtInfo.cs
- Site.cs
- IPAddress.cs
- MachineKeyConverter.cs
- VideoDrawing.cs
- AuthenticationException.cs
- DataViewSetting.cs
- AlphabetConverter.cs
- RootProfilePropertySettingsCollection.cs
- ClientCredentialsElement.cs
- OverrideMode.cs
- HyperLink.cs
- EditorBrowsableAttribute.cs
- WebPartConnection.cs
- SocketAddress.cs
- RemoteWebConfigurationHost.cs
- COAUTHINFO.cs
- List.cs
- MSHTMLHost.cs
- ReliableChannelListener.cs
- OpenTypeLayoutCache.cs
- EncoderParameter.cs
- ScriptingRoleServiceSection.cs
- Utils.cs
- Compiler.cs
- remotingproxy.cs
- DayRenderEvent.cs
- FixedTextSelectionProcessor.cs