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
- SqlCrossApplyToCrossJoin.cs
- CompilerGeneratedAttribute.cs
- ModelVisual3D.cs
- FileRecordSequenceCompletedAsyncResult.cs
- PersonalizationProviderCollection.cs
- XmlSchemaProviderAttribute.cs
- XmlMembersMapping.cs
- CodeBlockBuilder.cs
- SmiTypedGetterSetter.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- PointLight.cs
- NameScopePropertyAttribute.cs
- SourceFilter.cs
- XsdCachingReader.cs
- SubMenuStyle.cs
- DataSourceControl.cs
- DataServiceContext.cs
- ConfigurationSectionCollection.cs
- AdCreatedEventArgs.cs
- VideoDrawing.cs
- _UncName.cs
- ApplicationBuildProvider.cs
- AsymmetricSignatureFormatter.cs
- ComplusEndpointConfigContainer.cs
- InternalConfigRoot.cs
- ReaderOutput.cs
- SchemaImporter.cs
- TitleStyle.cs
- wmiprovider.cs
- EdmRelationshipRoleAttribute.cs
- AppDomainShutdownMonitor.cs
- ProfileBuildProvider.cs
- StringResourceManager.cs
- Button.cs
- BamlStream.cs
- dbdatarecord.cs
- OneOfElement.cs
- ScrollProperties.cs
- SchemaCollectionPreprocessor.cs
- DrawingContextDrawingContextWalker.cs
- ClientFormsAuthenticationMembershipProvider.cs
- TreeNode.cs
- NeutralResourcesLanguageAttribute.cs
- _ShellExpression.cs
- WebPartConnectionCollection.cs
- ExpressionBuilder.cs
- CodeCommentStatementCollection.cs
- Emitter.cs
- Config.cs
- GlyphRunDrawing.cs
- SynchronousSendBindingElement.cs
- StrokeNodeOperations2.cs
- SharedTcpTransportManager.cs
- RegexCompilationInfo.cs
- DefaultWorkflowLoaderService.cs
- Pen.cs
- ErrorEventArgs.cs
- PageThemeParser.cs
- ResXFileRef.cs
- XmlILConstructAnalyzer.cs
- ExecutionContext.cs
- RuleSetReference.cs
- BuildProvider.cs
- LinkedList.cs
- XmlDocumentFragment.cs
- EdgeProfileValidation.cs
- VisualTreeFlattener.cs
- WebPartDisplayModeEventArgs.cs
- _DisconnectOverlappedAsyncResult.cs
- FormViewDeletedEventArgs.cs
- ProtectedProviderSettings.cs
- CookieParameter.cs
- Normalizer.cs
- XmlAttributeOverrides.cs
- TableSectionStyle.cs
- DataServiceCollectionOfT.cs
- Schema.cs
- SingleSelectRootGridEntry.cs
- IdentityModelStringsVersion1.cs
- CodeTypeMember.cs
- TextRangeEditLists.cs
- KeySpline.cs
- SoapAttributes.cs
- EntityDataSourceColumn.cs
- _DigestClient.cs
- MenuItem.cs
- DataGridViewCellMouseEventArgs.cs
- ListControlConvertEventArgs.cs
- SolidBrush.cs
- Cell.cs
- DesignerActionListCollection.cs
- ResponseBodyWriter.cs
- SizeConverter.cs
- WebSysDisplayNameAttribute.cs
- SqlProcedureAttribute.cs
- ExtractorMetadata.cs
- FlowDocumentView.cs
- TextInfo.cs
- TreeNodeBindingDepthConverter.cs
- SourceFileInfo.cs