Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DesignOnlyAttribute.cs
- DataGridViewImageColumn.cs
- BufferedReceiveElement.cs
- EqualityComparer.cs
- ContextStaticAttribute.cs
- ReadWriteObjectLock.cs
- ThrowHelper.cs
- RSACryptoServiceProvider.cs
- Base64Encoder.cs
- PeerDefaultCustomResolverClient.cs
- TrackingMemoryStreamFactory.cs
- TokenizerHelper.cs
- StyleSheetRefUrlEditor.cs
- FixedSOMTableCell.cs
- InternalEnumValidatorAttribute.cs
- DesignerAutoFormatStyle.cs
- ReferentialConstraint.cs
- ImageFormat.cs
- _CacheStreams.cs
- CellConstant.cs
- ColorAnimationUsingKeyFrames.cs
- ImplicitInputBrush.cs
- _NegoStream.cs
- CompilerScope.Storage.cs
- ExpressionPrefixAttribute.cs
- FactoryMaker.cs
- XPathDescendantIterator.cs
- CompiledXpathExpr.cs
- EventMetadata.cs
- SharedUtils.cs
- PropertyEmitterBase.cs
- WebColorConverter.cs
- SQlBooleanStorage.cs
- NetStream.cs
- ChtmlCommandAdapter.cs
- ComponentRenameEvent.cs
- OptionUsage.cs
- RequiredFieldValidator.cs
- InternalConfigConfigurationFactory.cs
- WebPartConnectionsCancelEventArgs.cs
- CustomTypeDescriptor.cs
- EventLogPermissionHolder.cs
- XmlEventCache.cs
- SettingsSavedEventArgs.cs
- ListManagerBindingsCollection.cs
- ReflectPropertyDescriptor.cs
- StylusShape.cs
- HttpListenerRequest.cs
- MenuTracker.cs
- PerformanceCounterPermissionEntryCollection.cs
- SplitterCancelEvent.cs
- XmlSchemaNotation.cs
- WebPartDisplayModeCollection.cs
- SwitchLevelAttribute.cs
- XmlNamedNodeMap.cs
- DataViewSetting.cs
- TabItemAutomationPeer.cs
- SchemaEntity.cs
- COM2ExtendedBrowsingHandler.cs
- BitStack.cs
- GroupBox.cs
- ActivityInstanceMap.cs
- InputLanguage.cs
- StylusPlugInCollection.cs
- Buffer.cs
- DataServiceRequestException.cs
- _BaseOverlappedAsyncResult.cs
- DispatchChannelSink.cs
- QueryOperatorEnumerator.cs
- ExceptionHandler.cs
- WebPartConnection.cs
- VariableExpressionConverter.cs
- XmlSchemaSimpleContentRestriction.cs
- MimeBasePart.cs
- AutomationEventArgs.cs
- GcSettings.cs
- XmlDataContract.cs
- WebUtil.cs
- RayHitTestParameters.cs
- ExpressionNode.cs
- X509Logo.cs
- PageRouteHandler.cs
- SettingsPropertyValueCollection.cs
- _CommandStream.cs
- TextBox.cs
- Pair.cs
- TextContainerHelper.cs
- CodeArrayIndexerExpression.cs
- ListBox.cs
- PropertyEmitter.cs
- EncodingStreamWrapper.cs
- GenericRootAutomationPeer.cs
- KeyGesture.cs
- PenThreadPool.cs
- SoapMessage.cs
- ProgressBarAutomationPeer.cs
- SafeRightsManagementQueryHandle.cs
- TranslateTransform.cs
- grammarelement.cs
- OracleDateTime.cs