Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / TypeInitializationException.cs / 1 / TypeInitializationException.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================================== ** ** Class: TypeInitializationException ** ** ** Purpose: The exception class to wrap exceptions thrown by ** a type's class initializer (.cctor). This is sufficiently ** distinct from a TypeLoadException, which means we couldn't ** find the type. ** ** =============================================================================*/ using System; using System.Runtime.Serialization; using System.Globalization; using System.Security.Permissions; namespace System { [Serializable()] [System.Runtime.InteropServices.ComVisible(true)] public sealed class TypeInitializationException : SystemException { private String _typeName; // This exception is not creatable without specifying the // inner exception. private TypeInitializationException() : base(Environment.GetResourceString("TypeInitialization_Default")) { SetErrorCode(__HResults.COR_E_TYPEINITIALIZATION); } // This is called from within the runtime. I believe this is necessary // for Interop only, though it's not particularly useful. private TypeInitializationException(String message) : base(message) { SetErrorCode(__HResults.COR_E_TYPEINITIALIZATION); } public TypeInitializationException(String fullTypeName, Exception innerException) : base(String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("TypeInitialization_Type"), fullTypeName), innerException) { _typeName = fullTypeName; SetErrorCode(__HResults.COR_E_TYPEINITIALIZATION); } internal TypeInitializationException(SerializationInfo info, StreamingContext context) : base(info, context) { _typeName = info.GetString("TypeName"); } public String TypeName { get { if (_typeName == null) { return String.Empty; } return _typeName; } } [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.SerializationFormatter)] public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); info.AddValue("TypeName",TypeName,typeof(String)); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Attributes.cs
- SequentialUshortCollection.cs
- DecoratedNameAttribute.cs
- Visual3D.cs
- WebBrowserSiteBase.cs
- TextTabProperties.cs
- SafeFileHandle.cs
- XmlUnspecifiedAttribute.cs
- SelectionProviderWrapper.cs
- RubberbandSelector.cs
- StatusBar.cs
- DataColumnMappingCollection.cs
- HttpCookie.cs
- COM2ColorConverter.cs
- ByteStream.cs
- SystemEvents.cs
- ObjectComplexPropertyMapping.cs
- PeerCredentialElement.cs
- PropertyContainer.cs
- Scripts.cs
- RelationshipSet.cs
- Nullable.cs
- uribuilder.cs
- FileReservationCollection.cs
- NotImplementedException.cs
- ReadOnlyDictionary.cs
- BridgeDataReader.cs
- DataGridViewIntLinkedList.cs
- ListViewInsertionMark.cs
- SqlException.cs
- ElapsedEventArgs.cs
- Utils.cs
- LayoutEditorPart.cs
- DebugView.cs
- CodeDelegateCreateExpression.cs
- _LocalDataStoreMgr.cs
- DiagnosticEventProvider.cs
- TypedDataSetSchemaImporterExtension.cs
- EventMappingSettingsCollection.cs
- TypeUnloadedException.cs
- SecurityStateEncoder.cs
- DataContractJsonSerializerOperationFormatter.cs
- ThreadAttributes.cs
- Window.cs
- WorkflowRuntime.cs
- SQLConvert.cs
- RepeatButton.cs
- WebPartDisplayModeCollection.cs
- RootBrowserWindow.cs
- XmlArrayAttribute.cs
- AttachmentCollection.cs
- ResourceReader.cs
- CodeDomDecompiler.cs
- SQLDateTime.cs
- TerminatorSinks.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- DataViewManager.cs
- CommandDevice.cs
- SHA512.cs
- FileLogRecordHeader.cs
- SqlHelper.cs
- HtmlTableRowCollection.cs
- AppliesToBehaviorDecisionTable.cs
- NamespaceCollection.cs
- KeyValueConfigurationElement.cs
- ObjectAnimationUsingKeyFrames.cs
- XmlNullResolver.cs
- DecoderFallback.cs
- AggregatePushdown.cs
- _IPv4Address.cs
- Viewport2DVisual3D.cs
- XmlReader.cs
- CornerRadiusConverter.cs
- StateItem.cs
- DoubleStorage.cs
- StorageMappingFragment.cs
- Rect3D.cs
- UnsafeNativeMethods.cs
- HttpResponse.cs
- ValueTable.cs
- EventOpcode.cs
- SoapFault.cs
- ConnectionConsumerAttribute.cs
- WindowsGraphicsCacheManager.cs
- TabPage.cs
- OnOperation.cs
- DescriptionAttribute.cs
- HorizontalAlignConverter.cs
- DetailsViewRowCollection.cs
- HideDisabledControlAdapter.cs
- SafeRightsManagementPubHandle.cs
- ImageButton.cs
- WindowsIPAddress.cs
- PrimitiveXmlSerializers.cs
- InvokePattern.cs
- SwitchElementsCollection.cs
- RepeaterCommandEventArgs.cs
- SqlSelectStatement.cs
- VisualTarget.cs
- ObjectNotFoundException.cs