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
- TableItemPatternIdentifiers.cs
- TextModifier.cs
- DeploymentSection.cs
- SecUtil.cs
- StyleHelper.cs
- FileDialog_Vista_Interop.cs
- XsltException.cs
- ExtensibleClassFactory.cs
- TextEffectResolver.cs
- WebPartConnectVerb.cs
- TextPointerBase.cs
- RowCache.cs
- ConfigurationValidatorBase.cs
- MulticastOption.cs
- HttpCacheVary.cs
- _LocalDataStoreMgr.cs
- TraceListener.cs
- XPathPatternParser.cs
- TraceSection.cs
- HtmlDocument.cs
- HtmlInputCheckBox.cs
- ActivityXRefConverter.cs
- SplitterEvent.cs
- basenumberconverter.cs
- WbmpConverter.cs
- DriveInfo.cs
- VScrollBar.cs
- WorkerRequest.cs
- Drawing.cs
- TimeSpanOrInfiniteValidator.cs
- OleDbError.cs
- GeneralTransform3DTo2DTo3D.cs
- BindingList.cs
- XmlObjectSerializerReadContextComplex.cs
- XmlDownloadManager.cs
- PositiveTimeSpanValidator.cs
- ConditionalWeakTable.cs
- SelectionChangedEventArgs.cs
- UriSection.cs
- DataSourceDesigner.cs
- XmlSchemaInclude.cs
- RangeBase.cs
- safelinkcollection.cs
- LinkLabelLinkClickedEvent.cs
- UserPreferenceChangingEventArgs.cs
- CacheHelper.cs
- SchemaSetCompiler.cs
- Inflater.cs
- WinInetCache.cs
- CompatibleIComparer.cs
- SecureUICommand.cs
- SoapTypeAttribute.cs
- ImageResources.Designer.cs
- SendKeys.cs
- Atom10FormatterFactory.cs
- CompoundFileStorageReference.cs
- QilTargetType.cs
- ResourceDescriptionAttribute.cs
- ClientFormsIdentity.cs
- CaseInsensitiveHashCodeProvider.cs
- ListItemCollection.cs
- ExpressionBuilderContext.cs
- securestring.cs
- FileUpload.cs
- StateValidator.cs
- InstanceDataCollection.cs
- CollectionBase.cs
- ImagingCache.cs
- TypeConstant.cs
- PropertyFilter.cs
- SecondaryIndexList.cs
- XMLSchema.cs
- UnsafeNativeMethods.cs
- SafeFileMappingHandle.cs
- AdCreatedEventArgs.cs
- MoveSizeWinEventHandler.cs
- DataTableMapping.cs
- TriggerAction.cs
- SafeFileMappingHandle.cs
- JpegBitmapEncoder.cs
- OLEDB_Util.cs
- WebException.cs
- HtmlInputControl.cs
- unsafeIndexingFilterStream.cs
- ElementAction.cs
- TextTreeTextElementNode.cs
- PageClientProxyGenerator.cs
- TdsParameterSetter.cs
- DateTimeConstantAttribute.cs
- CngProperty.cs
- Assembly.cs
- SQLInt64Storage.cs
- InvalidateEvent.cs
- RtfControlWordInfo.cs
- BindingNavigatorDesigner.cs
- RedistVersionInfo.cs
- XmlSchemaSubstitutionGroup.cs
- SizeAnimation.cs
- InvokeBinder.cs
- LogicalExpr.cs