Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- DebugHandleTracker.cs
- CompileXomlTask.cs
- ComponentDispatcherThread.cs
- InheritedPropertyChangedEventArgs.cs
- TextDecoration.cs
- WebPartRestoreVerb.cs
- MappingSource.cs
- CodeIndexerExpression.cs
- ProgressBarHighlightConverter.cs
- CompiledIdentityConstraint.cs
- WorkflowRuntimeSection.cs
- SourceFileInfo.cs
- ActiveXHost.cs
- PointKeyFrameCollection.cs
- SelectingProviderEventArgs.cs
- Form.cs
- MailHeaderInfo.cs
- Publisher.cs
- Table.cs
- ConvertEvent.cs
- TextServicesCompartment.cs
- FreezableDefaultValueFactory.cs
- OracleParameterBinding.cs
- BinaryParser.cs
- ElementAction.cs
- FastPropertyAccessor.cs
- ServiceModelPerformanceCounters.cs
- SpellCheck.cs
- FixedDSBuilder.cs
- RuntimeWrappedException.cs
- ToolStripDropDownClosedEventArgs.cs
- XmlILConstructAnalyzer.cs
- MsmqIntegrationSecurityElement.cs
- HttpCacheParams.cs
- HandleRef.cs
- FragmentNavigationEventArgs.cs
- DataColumnMappingCollection.cs
- FormsAuthenticationEventArgs.cs
- TimeoutStream.cs
- ExpandCollapsePatternIdentifiers.cs
- DataSourceCacheDurationConverter.cs
- TextEmbeddedObject.cs
- CssTextWriter.cs
- ByteArrayHelperWithString.cs
- Padding.cs
- ConstraintConverter.cs
- ProtectedConfigurationProviderCollection.cs
- RuntimeVariablesExpression.cs
- GridViewSortEventArgs.cs
- PreProcessor.cs
- XmlNodeChangedEventManager.cs
- AbsoluteQuery.cs
- SQLUtility.cs
- Point3DCollection.cs
- Matrix3D.cs
- PrintDialogException.cs
- XDRSchema.cs
- CuspData.cs
- GridViewRowEventArgs.cs
- LogFlushAsyncResult.cs
- XmlParserContext.cs
- LocalizationComments.cs
- ShutDownListener.cs
- Models.cs
- NativeObjectSecurity.cs
- SystemEvents.cs
- FormsAuthenticationConfiguration.cs
- CustomAttribute.cs
- ConfigXmlCDataSection.cs
- SQLInt16.cs
- HGlobalSafeHandle.cs
- NativeCompoundFileAPIs.cs
- XamlDesignerSerializationManager.cs
- DataGridItemCollection.cs
- EventMappingSettingsCollection.cs
- HtmlElement.cs
- RawStylusInputCustomData.cs
- OracleLob.cs
- SectionInput.cs
- SelectionService.cs
- FieldValue.cs
- C14NUtil.cs
- WpfWebRequestHelper.cs
- ChildTable.cs
- Parallel.cs
- EastAsianLunisolarCalendar.cs
- MessageLogger.cs
- Subtree.cs
- TextWriterTraceListener.cs
- ACL.cs
- JsonServiceDocumentSerializer.cs
- StoreContentChangedEventArgs.cs
- SQLSingleStorage.cs
- SignHashRequest.cs
- RemoteWebConfigurationHostServer.cs
- BindingContext.cs
- PointKeyFrameCollection.cs
- ValueTable.cs
- ControlAdapter.cs
- LongPath.cs