Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Runtime / InteropServices / ExternalException.cs / 1305376 / ExternalException.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================================== ** ** Class: ExternalException ** ** ** Purpose: Exception base class for all errors from Interop or Structured ** Exception Handling code. ** ** =============================================================================*/ namespace System.Runtime.InteropServices { using System; using System.Globalization; using System.Runtime.Serialization; // Base exception for COM Interop errors &; Structured Exception Handler // exceptions. // [System.Runtime.InteropServices.ComVisible(true)] [Serializable] public class ExternalException : SystemException { public ExternalException() : base(Environment.GetResourceString("Arg_ExternalException")) { SetErrorCode(__HResults.E_FAIL); } public ExternalException(String message) : base(message) { SetErrorCode(__HResults.E_FAIL); } public ExternalException(String message, Exception inner) : base(message, inner) { SetErrorCode(__HResults.E_FAIL); } public ExternalException(String message,int errorCode) : base(message) { SetErrorCode(errorCode); } [System.Security.SecuritySafeCritical] // auto-generated protected ExternalException(SerializationInfo info, StreamingContext context) : base(info, context) { } public virtual int ErrorCode { get { return HResult; } } #if !FEATURE_CORECLR // Breaks the subset-of-Orcas property public override String ToString() { String message = Message; String s; String _className = GetType().ToString(); s = _className + " (0x" + HResult.ToString("X8", CultureInfo.InvariantCulture) + ")"; if (!(String.IsNullOrEmpty(message))) { s = s + ": " + message; } Exception _innerException = InnerException; if (_innerException!=null) { s = s + " ---> " + _innerException.ToString(); } if (StackTrace != null) s += Environment.NewLine + StackTrace; return s; } #endif // !FEATURE_CORECLR } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================================== ** ** Class: ExternalException ** ** ** Purpose: Exception base class for all errors from Interop or Structured ** Exception Handling code. ** ** =============================================================================*/ namespace System.Runtime.InteropServices { using System; using System.Globalization; using System.Runtime.Serialization; // Base exception for COM Interop errors &; Structured Exception Handler // exceptions. // [System.Runtime.InteropServices.ComVisible(true)] [Serializable] public class ExternalException : SystemException { public ExternalException() : base(Environment.GetResourceString("Arg_ExternalException")) { SetErrorCode(__HResults.E_FAIL); } public ExternalException(String message) : base(message) { SetErrorCode(__HResults.E_FAIL); } public ExternalException(String message, Exception inner) : base(message, inner) { SetErrorCode(__HResults.E_FAIL); } public ExternalException(String message,int errorCode) : base(message) { SetErrorCode(errorCode); } [System.Security.SecuritySafeCritical] // auto-generated protected ExternalException(SerializationInfo info, StreamingContext context) : base(info, context) { } public virtual int ErrorCode { get { return HResult; } } #if !FEATURE_CORECLR // Breaks the subset-of-Orcas property public override String ToString() { String message = Message; String s; String _className = GetType().ToString(); s = _className + " (0x" + HResult.ToString("X8", CultureInfo.InvariantCulture) + ")"; if (!(String.IsNullOrEmpty(message))) { s = s + ": " + message; } Exception _innerException = InnerException; if (_innerException!=null) { s = s + " ---> " + _innerException.ToString(); } if (StackTrace != null) s += Environment.NewLine + StackTrace; return s; } #endif // !FEATURE_CORECLR } } // 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
- FtpWebRequest.cs
- LocalValueEnumerator.cs
- RootContext.cs
- BamlRecordHelper.cs
- TextElement.cs
- FaultHandlingFilter.cs
- EntityViewContainer.cs
- RelationshipConverter.cs
- ProfileModule.cs
- PkcsUtils.cs
- Blend.cs
- DATA_BLOB.cs
- AlignmentYValidation.cs
- FlowLayoutSettings.cs
- MessageQueueTransaction.cs
- HotSpotCollection.cs
- TransformationRules.cs
- IsolatedStorageFile.cs
- PartialCachingControl.cs
- MetadataCache.cs
- EntityConnectionStringBuilderItem.cs
- DoubleUtil.cs
- TextComposition.cs
- TabPage.cs
- TrackingStringDictionary.cs
- Vector3DValueSerializer.cs
- TextRunProperties.cs
- OrderedEnumerableRowCollection.cs
- ListControlConvertEventArgs.cs
- Polyline.cs
- XmlSchemaNotation.cs
- BaseComponentEditor.cs
- ConfigurationSchemaErrors.cs
- ChangeBlockUndoRecord.cs
- ProvidePropertyAttribute.cs
- KeyValuePair.cs
- TableHeaderCell.cs
- ConstructorNeedsTagAttribute.cs
- jithelpers.cs
- AstTree.cs
- ListBoxItemAutomationPeer.cs
- ListSourceHelper.cs
- VirtualPathProvider.cs
- AdapterUtil.cs
- CompilationUnit.cs
- BoolExpr.cs
- DataControlFieldHeaderCell.cs
- HashFinalRequest.cs
- TextBoxBase.cs
- IEnumerable.cs
- ContentPlaceHolder.cs
- VectorCollection.cs
- CodeCastExpression.cs
- Assert.cs
- DataServices.cs
- CollectionCodeDomSerializer.cs
- DbCommandTree.cs
- XmlUtf8RawTextWriter.cs
- DBDataPermissionAttribute.cs
- NumberFunctions.cs
- MetadataItemEmitter.cs
- WorkflowApplicationAbortedException.cs
- Calendar.cs
- FileSystemInfo.cs
- X509Extension.cs
- ProfileParameter.cs
- MdiWindowListItemConverter.cs
- RemoteCryptoSignHashRequest.cs
- BitmapEncoder.cs
- BinHexEncoder.cs
- ErrorWebPart.cs
- ComContractElementCollection.cs
- SessionStateContainer.cs
- XmlQueryRuntime.cs
- DuplexChannelBinder.cs
- MailWriter.cs
- FixedDocument.cs
- ThreadPoolTaskScheduler.cs
- Translator.cs
- QilNode.cs
- TiffBitmapDecoder.cs
- StringAnimationUsingKeyFrames.cs
- GridViewSelectEventArgs.cs
- JumpList.cs
- CriticalHandle.cs
- CapabilitiesAssignment.cs
- ReturnType.cs
- BindingGroup.cs
- TextPointerBase.cs
- EncodingDataItem.cs
- UniqueIdentifierService.cs
- ThreadStaticAttribute.cs
- Source.cs
- TextEditorSpelling.cs
- FileDialog.cs
- ReadOnlyMetadataCollection.cs
- ServerValidateEventArgs.cs
- TargetControlTypeCache.cs
- SchemaImporterExtensionsSection.cs
- Stroke2.cs