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
- DataBoundControlAdapter.cs
- WebPartCatalogAddVerb.cs
- CompilerTypeWithParams.cs
- DBParameter.cs
- XPathBuilder.cs
- VariableExpressionConverter.cs
- EntityCommandDefinition.cs
- ObjectDataSourceSelectingEventArgs.cs
- ButtonFlatAdapter.cs
- ImpersonateTokenRef.cs
- VideoDrawing.cs
- WindowsMenu.cs
- RoamingStoreFile.cs
- Errors.cs
- ExtendedPropertyInfo.cs
- FrameworkPropertyMetadata.cs
- LassoSelectionBehavior.cs
- HttpProfileBase.cs
- FlowLayout.cs
- GridView.cs
- Transform3DGroup.cs
- ClassicBorderDecorator.cs
- TableLayoutColumnStyleCollection.cs
- DoubleLinkListEnumerator.cs
- DisplayMemberTemplateSelector.cs
- DataSvcMapFileSerializer.cs
- SqlClientFactory.cs
- EarlyBoundInfo.cs
- Odbc32.cs
- UserNamePasswordValidator.cs
- PeerCollaborationPermission.cs
- BrowserDefinitionCollection.cs
- RectangleHotSpot.cs
- TemplatedMailWebEventProvider.cs
- VisualProxy.cs
- DataGridViewCellCollection.cs
- PolyQuadraticBezierSegment.cs
- EdmRelationshipRoleAttribute.cs
- PolicyLevel.cs
- SystemIPInterfaceProperties.cs
- BitmapVisualManager.cs
- RadioButtonStandardAdapter.cs
- RequiredFieldValidator.cs
- _SslSessionsCache.cs
- GB18030Encoding.cs
- FontFamily.cs
- EventBuilder.cs
- DataControlImageButton.cs
- Stack.cs
- InterleavedZipPartStream.cs
- CallSiteBinder.cs
- SafePointer.cs
- TextBox.cs
- PreservationFileWriter.cs
- Timeline.cs
- X509Certificate.cs
- WorkflowCreationContext.cs
- SessionEndedEventArgs.cs
- Form.cs
- WebEventCodes.cs
- CellTreeNodeVisitors.cs
- GeneralTransformCollection.cs
- SelectorItemAutomationPeer.cs
- ExchangeUtilities.cs
- MgmtConfigurationRecord.cs
- StylusButtonEventArgs.cs
- UnmanagedMemoryStreamWrapper.cs
- SByteStorage.cs
- ListControl.cs
- BehaviorEditorPart.cs
- ExpressionParser.cs
- TakeQueryOptionExpression.cs
- FixedSchema.cs
- RemotingException.cs
- LongValidatorAttribute.cs
- IDictionary.cs
- CharUnicodeInfo.cs
- NativeMsmqMessage.cs
- MiniMapControl.xaml.cs
- TextProperties.cs
- WindowsContainer.cs
- InvocationExpression.cs
- StateMachineAction.cs
- XmlSchemaRedefine.cs
- HttpSessionStateWrapper.cs
- InfoCardBaseException.cs
- TerminatingOperationBehavior.cs
- TreeBuilderBamlTranslator.cs
- WorkflowInstanceQuery.cs
- Header.cs
- GeneratedContractType.cs
- Label.cs
- SeekStoryboard.cs
- MDIClient.cs
- WebPartMinimizeVerb.cs
- DataGridViewComboBoxColumn.cs
- SerializationException.cs
- AnnotationResourceCollection.cs
- Compilation.cs
- _SSPIWrapper.cs