Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // 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)); } } } // 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
- EventSinkHelperWriter.cs
- WasNotInstalledException.cs
- StreamMarshaler.cs
- Rethrow.cs
- IsolatedStoragePermission.cs
- Control.cs
- PeerCredentialElement.cs
- Int32AnimationBase.cs
- Light.cs
- RichTextBoxAutomationPeer.cs
- TrustManagerPromptUI.cs
- WindowsContainer.cs
- SerializationStore.cs
- XmlSchemaCompilationSettings.cs
- _LocalDataStore.cs
- FixedSOMTableRow.cs
- UncommonField.cs
- OleDbConnection.cs
- GridItem.cs
- StringUtil.cs
- TextSelection.cs
- SmiSettersStream.cs
- SafePointer.cs
- CleanUpVirtualizedItemEventArgs.cs
- LogEntry.cs
- datacache.cs
- WindowsIdentity.cs
- Rotation3DKeyFrameCollection.cs
- CaseInsensitiveComparer.cs
- AppSettingsExpressionBuilder.cs
- TransformedBitmap.cs
- InputMethodStateTypeInfo.cs
- WebPartTransformer.cs
- SafeLocalAllocation.cs
- ProcessHost.cs
- SecondaryIndexList.cs
- DoubleAnimationUsingKeyFrames.cs
- TypeDependencyAttribute.cs
- CustomError.cs
- ArcSegment.cs
- Property.cs
- EntityContainerEntitySetDefiningQuery.cs
- BaseResourcesBuildProvider.cs
- SocketPermission.cs
- ToolBarButtonClickEvent.cs
- XmlSiteMapProvider.cs
- LocatorManager.cs
- DataRowCollection.cs
- PropertyDescriptorGridEntry.cs
- HelpEvent.cs
- RawStylusInputCustomDataList.cs
- StringInfo.cs
- FileSystemWatcher.cs
- DataGridViewComboBoxColumnDesigner.cs
- SpecialNameAttribute.cs
- SmtpMail.cs
- TextFormatterImp.cs
- ImpersonateTokenRef.cs
- DrawingContextDrawingContextWalker.cs
- GroupQuery.cs
- ItemsPresenter.cs
- ItemsControl.cs
- DrawingAttributesDefaultValueFactory.cs
- EntitySqlQueryBuilder.cs
- StrokeFIndices.cs
- ComponentChangedEvent.cs
- MultiPageTextView.cs
- DataGridViewMethods.cs
- DefaultValueAttribute.cs
- Label.cs
- TabletDevice.cs
- FileVersion.cs
- ConfigurationLocation.cs
- DocumentPage.cs
- RSAOAEPKeyExchangeFormatter.cs
- Deserializer.cs
- EventProperty.cs
- QueryStatement.cs
- CultureData.cs
- OleDbDataAdapter.cs
- StylusDownEventArgs.cs
- FullTextState.cs
- DetailsView.cs
- CngProvider.cs
- Documentation.cs
- ModelUIElement3D.cs
- BaseTypeViewSchema.cs
- AggregateException.cs
- GradientSpreadMethodValidation.cs
- EventDescriptor.cs
- RoutedEventArgs.cs
- assertwrapper.cs
- ErrorItem.cs
- MouseBinding.cs
- SqlDataSourceWizardForm.cs
- RowUpdatedEventArgs.cs
- IntranetCredentialPolicy.cs
- RenameRuleObjectDialog.Designer.cs
- ReferencedCollectionType.cs
- FileDialogCustomPlaces.cs