Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- KeyTimeConverter.cs
- SqlUserDefinedTypeAttribute.cs
- BindingOperations.cs
- SqlFormatter.cs
- StrokeNodeData.cs
- SqlDataSourceQueryConverter.cs
- DataStreams.cs
- QuaternionAnimationBase.cs
- DataRecord.cs
- ReceiveContextCollection.cs
- SerializationFieldInfo.cs
- HtmlInputHidden.cs
- PointConverter.cs
- SimpleMailWebEventProvider.cs
- SecurityPolicySection.cs
- TreeViewItemAutomationPeer.cs
- SafeBitVector32.cs
- Exceptions.cs
- ContentControl.cs
- BinaryObjectReader.cs
- ICspAsymmetricAlgorithm.cs
- ConfigXmlAttribute.cs
- Win32MouseDevice.cs
- UnsupportedPolicyOptionsException.cs
- ClrProviderManifest.cs
- StrokeSerializer.cs
- QilList.cs
- RawStylusSystemGestureInputReport.cs
- SymmetricKeyWrap.cs
- ObjectDisposedException.cs
- RbTree.cs
- XmlWrappingWriter.cs
- DataAdapter.cs
- DataGridAutoFormat.cs
- EventlogProvider.cs
- Utils.cs
- Translator.cs
- TextShapeableCharacters.cs
- TextContainerChangeEventArgs.cs
- BaseCodePageEncoding.cs
- KnowledgeBase.cs
- XmlHierarchicalDataSourceView.cs
- Ray3DHitTestResult.cs
- QilStrConcatenator.cs
- DataSourceProvider.cs
- DataBindEngine.cs
- PlainXmlWriter.cs
- RouteParametersHelper.cs
- BooleanFunctions.cs
- PhonemeEventArgs.cs
- TrustSection.cs
- WebPartAuthorizationEventArgs.cs
- QilXmlReader.cs
- RectangleF.cs
- URL.cs
- DefaultAuthorizationContext.cs
- ClientSettings.cs
- AssociationEndMember.cs
- RemotingAttributes.cs
- HtmlTableRowCollection.cs
- ToolBar.cs
- GeneratedCodeAttribute.cs
- RoutedCommand.cs
- RectangleHotSpot.cs
- HttpClientProtocol.cs
- SQLBinaryStorage.cs
- TranslateTransform.cs
- SplitterPanelDesigner.cs
- DiscriminatorMap.cs
- Point3DAnimation.cs
- SizeKeyFrameCollection.cs
- XPathQueryGenerator.cs
- DragStartedEventArgs.cs
- XmlTextWriter.cs
- FloaterParagraph.cs
- ValidationEventArgs.cs
- ChtmlCommandAdapter.cs
- MenuScrollingVisibilityConverter.cs
- SurrogateSelector.cs
- PeerPresenceInfo.cs
- Control.cs
- GlyphCache.cs
- WSSecureConversation.cs
- Thread.cs
- SafeSecurityHelper.cs
- DataSetMappper.cs
- ComponentGuaranteesAttribute.cs
- ElementAction.cs
- BindingCompleteEventArgs.cs
- BindToObject.cs
- TransformCollection.cs
- PrivilegeNotHeldException.cs
- TypeInitializationException.cs
- BamlBinaryWriter.cs
- BitmapData.cs
- TreeNode.cs
- DataGridViewCheckBoxCell.cs
- RegexRunnerFactory.cs
- BoundPropertyEntry.cs
- MSAANativeProvider.cs