Code:
/ FX-1434 / FX-1434 / 1.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
- UnmanagedMemoryStreamWrapper.cs
- SkewTransform.cs
- ObjectDataSourceView.cs
- ObjectPersistData.cs
- ArrangedElement.cs
- WindowsToolbarAsMenu.cs
- HttpSocketManager.cs
- ToolStripLabel.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- MissingSatelliteAssemblyException.cs
- ComplexBindingPropertiesAttribute.cs
- ImportContext.cs
- RangeValidator.cs
- DataGridTableStyleMappingNameEditor.cs
- FontFamily.cs
- EventDescriptor.cs
- DefaultTraceListener.cs
- NetNamedPipeBinding.cs
- InfoCardTraceRecord.cs
- LocatorPart.cs
- Stylesheet.cs
- WebUtil.cs
- PriorityChain.cs
- PrintDialogException.cs
- CachedFontFace.cs
- Selector.cs
- NetCodeGroup.cs
- SchemaObjectWriter.cs
- Crc32.cs
- serverconfig.cs
- SharedStatics.cs
- Path.cs
- StandardToolWindows.cs
- sqlinternaltransaction.cs
- RegexGroup.cs
- HighContrastHelper.cs
- TreeBuilderBamlTranslator.cs
- CloudCollection.cs
- EventLogStatus.cs
- WindowsToolbarItemAsMenuItem.cs
- MaterialGroup.cs
- RegistryKey.cs
- GlobalizationSection.cs
- BaseComponentEditor.cs
- TextBounds.cs
- ObjectStateManagerMetadata.cs
- AssemblyInfo.cs
- DataListItemCollection.cs
- ResourceReader.cs
- PropVariant.cs
- DataServiceRequestOfT.cs
- MimeTypeAttribute.cs
- ArrayExtension.cs
- XmlHierarchicalDataSourceView.cs
- PartitionResolver.cs
- RelatedPropertyManager.cs
- PointAnimationUsingKeyFrames.cs
- PackageDigitalSignatureManager.cs
- PingOptions.cs
- SineEase.cs
- AssociationEndMember.cs
- PropertySourceInfo.cs
- RuntimeConfigLKG.cs
- OdbcConnectionFactory.cs
- SqlDataSourceSelectingEventArgs.cs
- TemplateBuilder.cs
- EmptyStringExpandableObjectConverter.cs
- Context.cs
- Executor.cs
- QuaternionAnimation.cs
- UrlMappingCollection.cs
- CmsInterop.cs
- PaperSize.cs
- DbConnectionOptions.cs
- PlatformCulture.cs
- xdrvalidator.cs
- TypefaceMap.cs
- OleDbWrapper.cs
- SQLString.cs
- ClientSettingsStore.cs
- Filter.cs
- ProfileParameter.cs
- DiscoveryServerProtocol.cs
- DefaultTextStoreTextComposition.cs
- XmlSubtreeReader.cs
- PerformanceCounterCategory.cs
- activationcontext.cs
- ExeConfigurationFileMap.cs
- MailHeaderInfo.cs
- SoapDocumentServiceAttribute.cs
- TextRunCacheImp.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- CodeDOMUtility.cs
- Drawing.cs
- NonBatchDirectoryCompiler.cs
- Deserializer.cs
- RegexReplacement.cs
- DictionarySectionHandler.cs
- AccessDataSourceWizardForm.cs
- GenerateScriptTypeAttribute.cs