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
- StringResourceManager.cs
- DashStyle.cs
- CodeNamespaceImportCollection.cs
- DateTimeConstantAttribute.cs
- ExpressionPrefixAttribute.cs
- dsa.cs
- _KerberosClient.cs
- DbConnectionStringBuilder.cs
- DoubleLinkList.cs
- WebPartVerbCollection.cs
- ListenerElementsCollection.cs
- ReferenceTypeElement.cs
- XmlSchemaSimpleTypeRestriction.cs
- IntegerValidator.cs
- InheritanceContextChangedEventManager.cs
- ActionFrame.cs
- Point4D.cs
- MetabaseServerConfig.cs
- SettingsAttributeDictionary.cs
- XomlCompilerParameters.cs
- Mappings.cs
- sitestring.cs
- BindingExpressionBase.cs
- SafeHandles.cs
- UiaCoreTypesApi.cs
- SecureStringHasher.cs
- TextRunCache.cs
- _KerberosClient.cs
- SizeChangedEventArgs.cs
- TempFiles.cs
- Panel.cs
- IsolationInterop.cs
- BitmapImage.cs
- SchemaDeclBase.cs
- WindowsStartMenu.cs
- NativeMethods.cs
- XPathArrayIterator.cs
- ListViewItem.cs
- DesignBindingValueUIHandler.cs
- RootProfilePropertySettingsCollection.cs
- ForwardPositionQuery.cs
- DefaultValueConverter.cs
- SignatureDescription.cs
- UIElement.cs
- AutomationEvent.cs
- MarshalByValueComponent.cs
- SerializationInfo.cs
- ComplusEndpointConfigContainer.cs
- DataGridViewCellValueEventArgs.cs
- AudienceUriMode.cs
- LockCookie.cs
- SymbolPair.cs
- RectAnimationUsingKeyFrames.cs
- PresentationSource.cs
- PerCallInstanceContextProvider.cs
- InvalidContentTypeException.cs
- InputProcessorProfilesLoader.cs
- DbConvert.cs
- RuleInfoComparer.cs
- Persist.cs
- SqlVersion.cs
- X509ChainElement.cs
- ByteConverter.cs
- ResourceDictionaryCollection.cs
- DbInsertCommandTree.cs
- ProxyGenerator.cs
- SqlWebEventProvider.cs
- WebScriptClientGenerator.cs
- XmlElementElementCollection.cs
- DeviceContext2.cs
- SqlFileStream.cs
- LambdaCompiler.Lambda.cs
- ToolStripItemClickedEventArgs.cs
- IsolatedStorageSecurityState.cs
- Bitmap.cs
- UInt16Converter.cs
- ToolStripContextMenu.cs
- DesignerTransactionCloseEvent.cs
- ControlType.cs
- baseaxisquery.cs
- AudioBase.cs
- CodeExporter.cs
- PrinterSettings.cs
- GridLengthConverter.cs
- RemoteTokenFactory.cs
- DbParameterCollection.cs
- ColorConverter.cs
- TypeBuilder.cs
- StreamInfo.cs
- CompilerScope.Storage.cs
- SqlSupersetValidator.cs
- NamespaceMapping.cs
- AliasGenerator.cs
- SqlWorkflowInstanceStore.cs
- SoapSchemaExporter.cs
- SafeCoTaskMem.cs
- XPathAncestorIterator.cs
- TogglePattern.cs
- ViewStateAttachedPropertyFeature.cs
- DebugView.cs