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
- OleDbParameter.cs
- SizeKeyFrameCollection.cs
- Binding.cs
- GPPOINT.cs
- DataRecord.cs
- BaseDataList.cs
- ClientSideQueueItem.cs
- ViewEventArgs.cs
- COM2PropertyBuilderUITypeEditor.cs
- DbProviderSpecificTypePropertyAttribute.cs
- TypeRestriction.cs
- Base64Decoder.cs
- MoveSizeWinEventHandler.cs
- WebBrowserHelper.cs
- PageContentAsyncResult.cs
- RayHitTestParameters.cs
- HtmlShim.cs
- HttpListenerRequestTraceRecord.cs
- ExceptionHandlers.cs
- GroupBoxDesigner.cs
- ProcessModuleCollection.cs
- ToolStripPanel.cs
- ActiveDocumentEvent.cs
- CodeDomLoader.cs
- StronglyTypedResourceBuilder.cs
- XMLSyntaxException.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- ChildTable.cs
- XmlSchemaSimpleContent.cs
- TextProperties.cs
- HttpBindingExtension.cs
- ProcessModule.cs
- ResXResourceWriter.cs
- CharAnimationBase.cs
- SizeAnimationBase.cs
- ToolStripScrollButton.cs
- ThrowHelper.cs
- ClientApiGenerator.cs
- SingleKeyFrameCollection.cs
- MatrixTransform3D.cs
- X509ChainPolicy.cs
- NumberEdit.cs
- RuntimeArgumentHandle.cs
- EarlyBoundInfo.cs
- ThemeableAttribute.cs
- Point3DCollectionConverter.cs
- MissingSatelliteAssemblyException.cs
- EpmSourcePathSegment.cs
- Constants.cs
- SystemColors.cs
- HtmlElement.cs
- WorkflowMarkupSerializationException.cs
- PositiveTimeSpanValidator.cs
- SizeConverter.cs
- ThreadInterruptedException.cs
- XmlSchemaDocumentation.cs
- ComponentResourceManager.cs
- InvokeMemberBinder.cs
- JsonServiceDocumentSerializer.cs
- ArrayWithOffset.cs
- ToolStripScrollButton.cs
- DataGridTextBox.cs
- WebBrowserSiteBase.cs
- UserControlDesigner.cs
- ThreadStaticAttribute.cs
- AnnotationObservableCollection.cs
- SyndicationSerializer.cs
- Odbc32.cs
- LayoutEngine.cs
- DiscardableAttribute.cs
- DeploymentSection.cs
- XmlMapping.cs
- Helper.cs
- XmlAttributeCache.cs
- BamlLocalizableResourceKey.cs
- DeliveryStrategy.cs
- InOutArgument.cs
- MaskedTextBoxDesignerActionList.cs
- MenuCommandService.cs
- TrackingWorkflowEventArgs.cs
- NullToBooleanConverter.cs
- XmlSerializer.cs
- StateInitializationDesigner.cs
- SecurityTokenRequirement.cs
- FindCriteriaApril2005.cs
- Row.cs
- ManipulationPivot.cs
- Stylus.cs
- OracleConnectionFactory.cs
- ItemDragEvent.cs
- XmlQueryContext.cs
- FastEncoderWindow.cs
- WebPartAuthorizationEventArgs.cs
- TableChangeProcessor.cs
- PrePostDescendentsWalker.cs
- FocusManager.cs
- XmlSchemaIdentityConstraint.cs
- BaseCodeDomTreeGenerator.cs
- ReadOnlyKeyedCollection.cs
- LoginDesigner.cs