Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Runtime / InteropServices / ErrorWrapper.cs / 1305376 / 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; } [System.Security.SecuritySafeCritical] // auto-generated [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; } [System.Security.SecuritySafeCritical] // auto-generated [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
- XamlClipboardData.cs
- MiniParameterInfo.cs
- ReachBasicContext.cs
- FileSystemWatcher.cs
- CanonicalFontFamilyReference.cs
- ReturnType.cs
- FormClosedEvent.cs
- SiteMapSection.cs
- FixedDocument.cs
- ObjectAssociationEndMapping.cs
- GeometryHitTestParameters.cs
- FixedSOMSemanticBox.cs
- ParenthesizePropertyNameAttribute.cs
- HashSetDebugView.cs
- WinInet.cs
- HttpCapabilitiesEvaluator.cs
- HtmlImage.cs
- FixedBufferAttribute.cs
- KeyInterop.cs
- GeneralTransform2DTo3D.cs
- SqlGenericUtil.cs
- AppSettingsExpressionBuilder.cs
- DataSourceViewSchemaConverter.cs
- BadImageFormatException.cs
- GatewayIPAddressInformationCollection.cs
- SystemDiagnosticsSection.cs
- printdlgexmarshaler.cs
- HtmlTextArea.cs
- ScriptingSectionGroup.cs
- CodeLinePragma.cs
- ListViewContainer.cs
- BitmapEffectState.cs
- SafePointer.cs
- OdbcDataAdapter.cs
- XmlILStorageConverter.cs
- ImageDrawing.cs
- CompilerResults.cs
- OdbcDataAdapter.cs
- WaitHandle.cs
- NumberFunctions.cs
- ToolStripPanel.cs
- EntityFunctions.cs
- TypeConverter.cs
- TagPrefixInfo.cs
- WebColorConverter.cs
- XmlRawWriterWrapper.cs
- PersonalizationStateQuery.cs
- RoleService.cs
- AppDomainFactory.cs
- WinFormsSecurity.cs
- ExcCanonicalXml.cs
- ProfilePropertyMetadata.cs
- basenumberconverter.cs
- UserControlParser.cs
- AccessViolationException.cs
- AspNetSynchronizationContext.cs
- basecomparevalidator.cs
- DecimalConstantAttribute.cs
- _HeaderInfoTable.cs
- SqlNode.cs
- FtpWebRequest.cs
- JoinCqlBlock.cs
- CryptoApi.cs
- IntranetCredentialPolicy.cs
- CodeRegionDirective.cs
- ListBoxAutomationPeer.cs
- DataGridViewRowsRemovedEventArgs.cs
- VisualCollection.cs
- DeferredReference.cs
- SapiRecoContext.cs
- SqlDataSourceCache.cs
- TdsParser.cs
- DataListItemEventArgs.cs
- ParentUndoUnit.cs
- UserControlBuildProvider.cs
- ISAPIWorkerRequest.cs
- DbConnectionHelper.cs
- DbParameterHelper.cs
- TextEmbeddedObject.cs
- WindowsStatic.cs
- HelpEvent.cs
- ScrollItemProviderWrapper.cs
- OracleException.cs
- ToolStripCodeDomSerializer.cs
- SecurityKeyIdentifierClause.cs
- XslCompiledTransform.cs
- AppSettingsReader.cs
- TextureBrush.cs
- CmsInterop.cs
- sqlinternaltransaction.cs
- RequestValidator.cs
- HorizontalAlignConverter.cs
- TreeIterators.cs
- EventArgs.cs
- NetMsmqBindingCollectionElement.cs
- HwndMouseInputProvider.cs
- GridItem.cs
- FreezableCollection.cs
- Int32Converter.cs
- Select.cs