Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- serverconfig.cs
- ValidatorCompatibilityHelper.cs
- TextRunCache.cs
- SoapSchemaImporter.cs
- SqlDataSourceFilteringEventArgs.cs
- ToolboxComponentsCreatedEventArgs.cs
- Transform3D.cs
- RegexCompilationInfo.cs
- SafeProcessHandle.cs
- _LazyAsyncResult.cs
- TargetException.cs
- ScrollViewer.cs
- SafeMILHandle.cs
- SQLDouble.cs
- _ServiceNameStore.cs
- EntityDataSourceDesignerHelper.cs
- ManagementInstaller.cs
- DataQuery.cs
- CodeLabeledStatement.cs
- CompModSwitches.cs
- ActivityTypeDesigner.xaml.cs
- DecimalConverter.cs
- CombinedGeometry.cs
- ExceptionHelpers.cs
- HMACSHA512.cs
- CodeExpressionStatement.cs
- SerializeAbsoluteContext.cs
- DBSqlParserTableCollection.cs
- OracleInternalConnection.cs
- TraceHandler.cs
- InputScope.cs
- ModuleElement.cs
- externdll.cs
- QueueException.cs
- DataServiceEntityAttribute.cs
- IntellisenseTextBox.cs
- WindowsSecurityToken.cs
- TextEditorMouse.cs
- ButtonRenderer.cs
- RegexStringValidatorAttribute.cs
- UnmanagedMemoryStream.cs
- DataGridViewDesigner.cs
- CodeSnippetExpression.cs
- OdbcConnectionString.cs
- webclient.cs
- ViewStateModeByIdAttribute.cs
- SecurityPermission.cs
- diagnosticsswitches.cs
- ImpersonateTokenRef.cs
- ASCIIEncoding.cs
- HostedTcpTransportManager.cs
- VirtualPath.cs
- UIElement.cs
- BaseTemplateParser.cs
- MatrixCamera.cs
- ToolStripCodeDomSerializer.cs
- ResXDataNode.cs
- EncoderFallback.cs
- FlowDocumentPage.cs
- columnmapkeybuilder.cs
- ToolbarAUtomationPeer.cs
- HashHelper.cs
- KeyConstraint.cs
- WebBrowser.cs
- contentDescriptor.cs
- PropertyItem.cs
- SimpleApplicationHost.cs
- _NetworkingPerfCounters.cs
- GridViewItemAutomationPeer.cs
- TypeGeneratedEventArgs.cs
- StrongNameIdentityPermission.cs
- MetadataArtifactLoaderFile.cs
- InternalsVisibleToAttribute.cs
- OutputCacheModule.cs
- AttributeCollection.cs
- EmptyControlCollection.cs
- DataKey.cs
- Point.cs
- CacheOutputQuery.cs
- JpegBitmapDecoder.cs
- InfoCardBinaryReader.cs
- LineServicesRun.cs
- DbMetaDataFactory.cs
- TreeSet.cs
- FacetChecker.cs
- DbParameterCollectionHelper.cs
- CodePageUtils.cs
- EndPoint.cs
- ImportCatalogPart.cs
- WebBrowserNavigatedEventHandler.cs
- TextRenderer.cs
- LexicalChunk.cs
- XsdDuration.cs
- SharedPerformanceCounter.cs
- ModelFactory.cs
- CollectionViewProxy.cs
- AdornerPresentationContext.cs
- CryptoStream.cs
- SmuggledIUnknown.cs
- DnsPermission.cs