Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- DataGridHeadersVisibilityToVisibilityConverter.cs
- CustomErrorCollection.cs
- VirtualizingPanel.cs
- DataGridViewComboBoxCell.cs
- UmAlQuraCalendar.cs
- TypedRowHandler.cs
- CultureSpecificStringDictionary.cs
- RegexWorker.cs
- OutputBuffer.cs
- SourceFilter.cs
- PrintPreviewGraphics.cs
- ConstraintCollection.cs
- PreProcessInputEventArgs.cs
- HtmlDocument.cs
- externdll.cs
- UnrecognizedPolicyAssertionElement.cs
- SqlDataSourceEnumerator.cs
- entityreference_tresulttype.cs
- AdRotator.cs
- PenContext.cs
- AnnouncementEndpointElement.cs
- CompilerHelpers.cs
- TextParagraphCache.cs
- ThreadAbortException.cs
- Clause.cs
- IODescriptionAttribute.cs
- RegisteredExpandoAttribute.cs
- MsmqIntegrationProcessProtocolHandler.cs
- Utilities.cs
- DockingAttribute.cs
- CodePageUtils.cs
- ToolStripScrollButton.cs
- DataServiceConfiguration.cs
- SqlVisitor.cs
- DesignTimeParseData.cs
- DecoderFallback.cs
- NullableIntSumAggregationOperator.cs
- CodeAttributeDeclarationCollection.cs
- ListViewItemEventArgs.cs
- WebPart.cs
- XmlSchemaGroupRef.cs
- CheckedListBox.cs
- TransportContext.cs
- Comparer.cs
- _ProxyChain.cs
- sqlstateclientmanager.cs
- ToolTipAutomationPeer.cs
- IndependentlyAnimatedPropertyMetadata.cs
- InfoCardX509Validator.cs
- InputLanguageManager.cs
- DataSetMappper.cs
- MutexSecurity.cs
- UpdateRecord.cs
- controlskin.cs
- TextBoxAutoCompleteSourceConverter.cs
- UInt16Storage.cs
- ControlPropertyNameConverter.cs
- Button.cs
- CheckBoxRenderer.cs
- SqlCacheDependency.cs
- XslAstAnalyzer.cs
- SimpleModelProvider.cs
- ListViewPagedDataSource.cs
- BitmapImage.cs
- DataGridViewControlCollection.cs
- control.ime.cs
- PageSettings.cs
- NamedPipeConnectionPool.cs
- FunctionQuery.cs
- BuilderPropertyEntry.cs
- FileNotFoundException.cs
- BaseCollection.cs
- OleDbMetaDataFactory.cs
- GridViewRow.cs
- OptimalTextSource.cs
- TextEditorMouse.cs
- CallContext.cs
- CookieProtection.cs
- XmlSchemaImporter.cs
- ExternalException.cs
- ArgIterator.cs
- DesignerDeviceConfig.cs
- SspiNegotiationTokenProvider.cs
- ImageConverter.cs
- CodeDomComponentSerializationService.cs
- IRCollection.cs
- LambdaCompiler.Lambda.cs
- EffectiveValueEntry.cs
- ControlAdapter.cs
- GifBitmapDecoder.cs
- TemplateXamlTreeBuilder.cs
- WeakEventTable.cs
- SqlCaseSimplifier.cs
- AttributeProviderAttribute.cs
- DeploymentSection.cs
- ToggleButtonAutomationPeer.cs
- BulletedList.cs
- InvalidDocumentContentsException.cs
- NetSectionGroup.cs
- DataGridClipboardHelper.cs