Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- RoutingService.cs
- CodePageUtils.cs
- DataServiceExpressionVisitor.cs
- FontFamily.cs
- AssertSection.cs
- SrgsOneOf.cs
- Compiler.cs
- SecurityIdentifierConverter.cs
- BindableTemplateBuilder.cs
- FunctionParameter.cs
- OdbcConnectionString.cs
- MenuItemStyleCollection.cs
- CachedBitmap.cs
- OleDbStruct.cs
- DataSet.cs
- ProtectedConfiguration.cs
- BinaryObjectReader.cs
- BooleanAnimationBase.cs
- SplashScreenNativeMethods.cs
- SiteMapDataSourceView.cs
- ZipIOExtraFieldElement.cs
- FontUnitConverter.cs
- EndPoint.cs
- XmlSchemaImport.cs
- UserPreferenceChangingEventArgs.cs
- NameValuePermission.cs
- Literal.cs
- FtpWebResponse.cs
- SqlDataAdapter.cs
- ScrollPattern.cs
- WebCategoryAttribute.cs
- ImageMapEventArgs.cs
- RawStylusInputCustomDataList.cs
- WmlLabelAdapter.cs
- PanelStyle.cs
- PerfCounterSection.cs
- ProfileSettingsCollection.cs
- PackageRelationshipSelector.cs
- RecognizedPhrase.cs
- PackageProperties.cs
- WorkflowTraceTransfer.cs
- ConditionCollection.cs
- ArraySubsetEnumerator.cs
- AutomationAttributeInfo.cs
- TraceRecord.cs
- ViewPort3D.cs
- __Error.cs
- TextEditorSpelling.cs
- WebDescriptionAttribute.cs
- DockPatternIdentifiers.cs
- DataColumnMapping.cs
- WebPartCollection.cs
- DeviceFilterDictionary.cs
- PropertyToken.cs
- AdornerLayer.cs
- LeafCellTreeNode.cs
- ResolveNextArgumentWorkItem.cs
- SetterBase.cs
- GeneralTransform3DCollection.cs
- RadioButton.cs
- XmlName.cs
- XmlWrappingReader.cs
- ToolStripItemEventArgs.cs
- MarkupProperty.cs
- MarkupCompilePass2.cs
- ObjectHandle.cs
- ProjectionNode.cs
- ColumnClickEvent.cs
- MethodExpr.cs
- XmlExceptionHelper.cs
- WebPartZoneBase.cs
- TemplateField.cs
- ProcessProtocolHandler.cs
- MouseCaptureWithinProperty.cs
- HtmlSelect.cs
- NativeMethods.cs
- EdmEntityTypeAttribute.cs
- MSHTMLHost.cs
- ClipboardProcessor.cs
- SizeF.cs
- MemoryFailPoint.cs
- HttpCacheParams.cs
- DataGridViewCellValueEventArgs.cs
- PropertyDescriptor.cs
- XmlValidatingReaderImpl.cs
- SettingsAttributeDictionary.cs
- nulltextnavigator.cs
- ResourceExpressionEditor.cs
- XPathException.cs
- Stack.cs
- PageParserFilter.cs
- ExpressionBindingCollection.cs
- TrackingMemoryStream.cs
- Random.cs
- ImageSource.cs
- AppDomainProtocolHandler.cs
- PathData.cs
- TrackingProfile.cs
- WebPartChrome.cs
- TemplatedAdorner.cs