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
- NotSupportedException.cs
- PathGeometry.cs
- WaitHandle.cs
- HttpInputStream.cs
- Control.cs
- DataPager.cs
- webeventbuffer.cs
- RequestCache.cs
- SelectorItemAutomationPeer.cs
- CollectionExtensions.cs
- SystemInformation.cs
- TextRangeProviderWrapper.cs
- PathSegmentCollection.cs
- MD5CryptoServiceProvider.cs
- ValidationUtility.cs
- RuntimeCompatibilityAttribute.cs
- MemberJoinTreeNode.cs
- TemplatedAdorner.cs
- SimpleRecyclingCache.cs
- ReadWriteSpinLock.cs
- WhileDesigner.cs
- HttpCacheVaryByContentEncodings.cs
- ControlHelper.cs
- ClientSettingsSection.cs
- PenLineCapValidation.cs
- MsmqIntegrationInputMessage.cs
- Models.cs
- QueueProcessor.cs
- CompoundFileStreamReference.cs
- ModuleConfigurationInfo.cs
- ContextDataSourceView.cs
- UnknownBitmapEncoder.cs
- DBDataPermission.cs
- ContentValidator.cs
- BuildProviderAppliesToAttribute.cs
- Themes.cs
- ClientSettingsProvider.cs
- ItemCollectionEditor.cs
- DataGridViewLinkCell.cs
- XhtmlBasicImageAdapter.cs
- ExtentCqlBlock.cs
- DetailsViewModeEventArgs.cs
- ContentOperations.cs
- IISMapPath.cs
- Vector3DCollectionValueSerializer.cs
- securitycriticaldata.cs
- FormViewUpdatedEventArgs.cs
- StreamSecurityUpgradeProvider.cs
- TextTreeUndoUnit.cs
- TransactionProxy.cs
- IChannel.cs
- StylusPointDescription.cs
- PcmConverter.cs
- ContentValidator.cs
- Attributes.cs
- SqlServer2KCompatibilityCheck.cs
- EventDescriptorCollection.cs
- infer.cs
- HandleRef.cs
- PlatformCulture.cs
- TargetFrameworkUtil.cs
- ScrollItemPatternIdentifiers.cs
- PrinterResolution.cs
- BitmapMetadata.cs
- SignatureToken.cs
- NamespaceInfo.cs
- NominalTypeEliminator.cs
- ValidatorCollection.cs
- ChtmlTextWriter.cs
- ResourceExpression.cs
- ActivityStatusChangeEventArgs.cs
- UndoEngine.cs
- ValueTypeFixupInfo.cs
- PerformanceCounterManager.cs
- CodeTypeParameterCollection.cs
- OdbcDataReader.cs
- Schema.cs
- ObjectStateManager.cs
- DesignerFrame.cs
- DrawingContextWalker.cs
- ObjectQueryExecutionPlan.cs
- _HelperAsyncResults.cs
- RelatedPropertyManager.cs
- AssemblyResolver.cs
- GeometryHitTestParameters.cs
- _ShellExpression.cs
- DateTimeSerializationSection.cs
- SiteMapNodeItem.cs
- PrivilegedConfigurationManager.cs
- SafeFindHandle.cs
- StagingAreaInputItem.cs
- ContainsRowNumberChecker.cs
- CompensatableTransactionScopeActivity.cs
- ScriptRegistrationManager.cs
- AssertSection.cs
- CodeConstructor.cs
- WindowsListViewSubItem.cs
- ConnectionManagementElementCollection.cs
- ValidationException.cs
- QilTargetType.cs