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
- NumberSubstitution.cs
- AnnotationMap.cs
- AsyncOperation.cs
- FileRecordSequence.cs
- TextTrailingWordEllipsis.cs
- EncodingNLS.cs
- TreeBuilderXamlTranslator.cs
- QueryContext.cs
- UInt64Storage.cs
- SmiTypedGetterSetter.cs
- SessionPageStatePersister.cs
- Transform3DGroup.cs
- DataGridSortCommandEventArgs.cs
- TreeNodeClickEventArgs.cs
- SingleResultAttribute.cs
- ToolZone.cs
- Component.cs
- Table.cs
- CompositeActivityValidator.cs
- DataBindingHandlerAttribute.cs
- NetworkAddressChange.cs
- FormViewDesigner.cs
- EllipseGeometry.cs
- DesignerActionVerbList.cs
- SoapAttributeOverrides.cs
- CodeExpressionRuleDeclaration.cs
- TdsEnums.cs
- ApplicationActivator.cs
- ViewGenResults.cs
- XPathConvert.cs
- DataSetSchema.cs
- DATA_BLOB.cs
- TiffBitmapDecoder.cs
- HtmlButton.cs
- BindingWorker.cs
- DbDataReader.cs
- UncommonField.cs
- BinHexEncoding.cs
- RegexMatch.cs
- CompensatableTransactionScopeActivity.cs
- FormDesigner.cs
- XhtmlConformanceSection.cs
- RenamedEventArgs.cs
- Closure.cs
- Intellisense.cs
- DebugView.cs
- DecryptedHeader.cs
- FillBehavior.cs
- TextLineResult.cs
- HostingEnvironmentWrapper.cs
- ScriptControl.cs
- Compiler.cs
- XmlSchemaAnyAttribute.cs
- SpeechDetectedEventArgs.cs
- ClickablePoint.cs
- dsa.cs
- VersionPair.cs
- ConfigXmlWhitespace.cs
- DbInsertCommandTree.cs
- WindowHideOrCloseTracker.cs
- BitmapEffect.cs
- LoadedOrUnloadedOperation.cs
- CompositeActivityDesigner.cs
- SamlDelegatingWriter.cs
- Int32AnimationBase.cs
- DocumentGridContextMenu.cs
- SamlAuthorizationDecisionClaimResource.cs
- BmpBitmapDecoder.cs
- ComponentTray.cs
- MapPathBasedVirtualPathProvider.cs
- ConfigXmlWhitespace.cs
- ArcSegment.cs
- DataControlFieldHeaderCell.cs
- WebMessageEncodingBindingElement.cs
- MachineKeySection.cs
- x509utils.cs
- WebEventCodes.cs
- GenericWebPart.cs
- Span.cs
- Attributes.cs
- NotCondition.cs
- RecognizerBase.cs
- UserNameServiceElement.cs
- BaseDataList.cs
- MouseBinding.cs
- TextBoxBase.cs
- ExpandSegmentCollection.cs
- HitTestFilterBehavior.cs
- TraceUtils.cs
- listviewsubitemcollectioneditor.cs
- LinkArea.cs
- TreeViewHitTestInfo.cs
- Manipulation.cs
- PixelFormat.cs
- C14NUtil.cs
- DataFormats.cs
- MonitorWrapper.cs
- CfgParser.cs
- GlyphRunDrawing.cs
- CodeExporter.cs