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
- Compiler.cs
- TableLayoutStyle.cs
- CompositeControl.cs
- CodeIterationStatement.cs
- KeyGestureConverter.cs
- TraceHandler.cs
- DES.cs
- CrossSiteScriptingValidation.cs
- SchemaContext.cs
- FontFamily.cs
- HttpPostProtocolReflector.cs
- RadioButtonFlatAdapter.cs
- ReadOnlyAttribute.cs
- SearchForVirtualItemEventArgs.cs
- LocalizabilityAttribute.cs
- ServiceModelExtensionCollectionElement.cs
- shaperfactoryquerycachekey.cs
- GreaterThan.cs
- TransformationRules.cs
- TracingConnectionInitiator.cs
- ListControlConvertEventArgs.cs
- OdbcDataAdapter.cs
- ConditionalAttribute.cs
- PseudoWebRequest.cs
- SynchronizedInputAdaptor.cs
- ResizeBehavior.cs
- DictionarySectionHandler.cs
- SecondaryIndexList.cs
- ViewCellRelation.cs
- WebPartVerb.cs
- AttributeEmitter.cs
- RegionData.cs
- SystemKeyConverter.cs
- ClientConfigurationHost.cs
- CurrentChangingEventArgs.cs
- Inline.cs
- OdbcFactory.cs
- AccessibleObject.cs
- BinaryEditor.cs
- SimplePropertyEntry.cs
- GeometryValueSerializer.cs
- FileVersion.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- FullTextState.cs
- MediaEntryAttribute.cs
- AccessorTable.cs
- CustomCategoryAttribute.cs
- NamedPipeTransportBindingElement.cs
- TemplateControl.cs
- UnaryNode.cs
- RelationshipManager.cs
- printdlgexmarshaler.cs
- OutputCacheProfileCollection.cs
- EntityContainerEntitySet.cs
- Propagator.ExtentPlaceholderCreator.cs
- IdentitySection.cs
- DocumentApplicationJournalEntry.cs
- SystemWebSectionGroup.cs
- RequestCachingSection.cs
- SafeCoTaskMem.cs
- FilteredDataSetHelper.cs
- KeyedCollection.cs
- AnnotationResourceCollection.cs
- CustomActivityDesigner.cs
- DataGridView.cs
- SqlDataSourceCache.cs
- ConnectionManager.cs
- WebCategoryAttribute.cs
- ECDsaCng.cs
- XmlSchemaDatatype.cs
- SHA512Managed.cs
- DbConnectionOptions.cs
- ConfigurationSettings.cs
- WCFServiceClientProxyGenerator.cs
- BamlTreeMap.cs
- ObjectItemAssemblyLoader.cs
- oledbmetadatacollectionnames.cs
- CodeExpressionStatement.cs
- PublishLicense.cs
- ImageList.cs
- NotifyCollectionChangedEventArgs.cs
- MeasurementDCInfo.cs
- Vector3DAnimationUsingKeyFrames.cs
- OptimalBreakSession.cs
- basenumberconverter.cs
- FlowDocumentPaginator.cs
- PropertyPushdownHelper.cs
- BamlCollectionHolder.cs
- BamlBinaryReader.cs
- AttributeQuery.cs
- HttpHandlerAction.cs
- ListViewItemCollectionEditor.cs
- SelectionHighlightInfo.cs
- QuaternionConverter.cs
- DataGridViewCheckBoxCell.cs
- LongPath.cs
- CustomCredentialPolicy.cs
- Sentence.cs
- CommandLibraryHelper.cs
- ComPersistableTypeElement.cs