Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / clr / src / BCL / System / Runtime / InteropServices / ErrorWrapper.cs / 1 / ErrorWrapper.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================================== ** ** Class: ErrorWrapper. ** ** ** Purpose: Wrapper that is converted to a variant with VT_ERROR. ** ** =============================================================================*/ namespace System.Runtime.InteropServices { using System; using System.Security.Permissions; [Serializable] [System.Runtime.InteropServices.ComVisible(true)] public sealed class ErrorWrapper { public ErrorWrapper(int errorCode) { m_ErrorCode = errorCode; } public ErrorWrapper(Object errorCode) { if (!(errorCode is int)) throw new ArgumentException(Environment.GetResourceString("Arg_MustBeInt32"), "errorCode"); m_ErrorCode = (int)errorCode; } [SecurityPermissionAttribute(SecurityAction.Demand, Flags=SecurityPermissionFlag.UnmanagedCode)] public ErrorWrapper(Exception e) { m_ErrorCode = Marshal.GetHRForException(e); } public int ErrorCode { get { return m_ErrorCode; } } private int m_ErrorCode; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================================== ** ** Class: ErrorWrapper. ** ** ** Purpose: Wrapper that is converted to a variant with VT_ERROR. ** ** =============================================================================*/ namespace System.Runtime.InteropServices { using System; using System.Security.Permissions; [Serializable] [System.Runtime.InteropServices.ComVisible(true)] public sealed class ErrorWrapper { public ErrorWrapper(int errorCode) { m_ErrorCode = errorCode; } public ErrorWrapper(Object errorCode) { if (!(errorCode is int)) throw new ArgumentException(Environment.GetResourceString("Arg_MustBeInt32"), "errorCode"); m_ErrorCode = (int)errorCode; } [SecurityPermissionAttribute(SecurityAction.Demand, Flags=SecurityPermissionFlag.UnmanagedCode)] public ErrorWrapper(Exception e) { m_ErrorCode = Marshal.GetHRForException(e); } public int ErrorCode { get { return m_ErrorCode; } } private int m_ErrorCode; } } // 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
- MSAANativeProvider.cs
- DataTableNewRowEvent.cs
- ProfilePropertyNameValidator.cs
- MsmqHostedTransportManager.cs
- HashRepartitionEnumerator.cs
- ScriptControlManager.cs
- AcceleratedTokenProviderState.cs
- ToolStripContentPanelRenderEventArgs.cs
- TextDocumentView.cs
- RadioButton.cs
- Storyboard.cs
- KeyInfo.cs
- XmlSchemaSimpleContentRestriction.cs
- SecurityTraceRecordHelper.cs
- InteropAutomationProvider.cs
- WindowsGraphics2.cs
- CodeRegionDirective.cs
- HttpListenerException.cs
- DropSource.cs
- SingleTagSectionHandler.cs
- XsdDuration.cs
- DataSourceCacheDurationConverter.cs
- FixedSchema.cs
- AccessControlEntry.cs
- CollectionChange.cs
- ButtonPopupAdapter.cs
- DurationConverter.cs
- MetadataItem_Static.cs
- DrawingVisual.cs
- SqlNotificationRequest.cs
- HttpResponseHeader.cs
- Command.cs
- TabletDevice.cs
- UInt32.cs
- SortAction.cs
- HttpCacheVary.cs
- HttpRawResponse.cs
- NativeMethods.cs
- WebServiceHost.cs
- GridViewColumnCollectionChangedEventArgs.cs
- DataContext.cs
- SimpleTypeResolver.cs
- SecurityUtils.cs
- CallbackException.cs
- UnitySerializationHolder.cs
- ColumnBinding.cs
- SettingsPropertyValue.cs
- MediaSystem.cs
- NumericUpDownAcceleration.cs
- _AuthenticationState.cs
- xmlsaver.cs
- EventOpcode.cs
- CqlParserHelpers.cs
- DataSourceXmlSerializer.cs
- DataBindingHandlerAttribute.cs
- WeakReference.cs
- PeerToPeerException.cs
- GcHandle.cs
- XmlObjectSerializerWriteContext.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- SimpleApplicationHost.cs
- ActivationServices.cs
- MemoryMappedViewStream.cs
- BamlResourceDeserializer.cs
- ElementProxy.cs
- SqlTriggerContext.cs
- RangeValueProviderWrapper.cs
- AddInIpcChannel.cs
- StandardToolWindows.cs
- RecognizedPhrase.cs
- ManagementObjectSearcher.cs
- VideoDrawing.cs
- ToolStripDesignerUtils.cs
- SymmetricKeyWrap.cs
- CommandHelpers.cs
- PageParserFilter.cs
- HtmlGenericControl.cs
- DataGridSortCommandEventArgs.cs
- SplitContainer.cs
- LambdaCompiler.Address.cs
- ContentTypeSettingDispatchMessageFormatter.cs
- ExpressionBinding.cs
- metadatamappinghashervisitor.cs
- hwndwrapper.cs
- WebPartDisplayModeCollection.cs
- UpDownBase.cs
- milexports.cs
- UnauthorizedAccessException.cs
- QueryExpr.cs
- DefaultEventAttribute.cs
- BoolExpressionVisitors.cs
- System.Data_BID.cs
- DataObjectAttribute.cs
- Translator.cs
- WebPartEditorCancelVerb.cs
- FragmentNavigationEventArgs.cs
- ACL.cs
- DataGridViewCellStyleConverter.cs
- MarginsConverter.cs
- FtpCachePolicyElement.cs