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
- QilXmlWriter.cs
- ellipse.cs
- CultureInfoConverter.cs
- updateconfighost.cs
- MULTI_QI.cs
- RuntimeTransactionHandle.cs
- Point3DConverter.cs
- DiffuseMaterial.cs
- UnsafeMethods.cs
- SafeArrayTypeMismatchException.cs
- UIHelper.cs
- GeometryGroup.cs
- HandlerWithFactory.cs
- TextProperties.cs
- _NegotiateClient.cs
- FixedHyperLink.cs
- RegexCompiler.cs
- StringFunctions.cs
- BooleanFacetDescriptionElement.cs
- DataGridViewLayoutData.cs
- PageHandlerFactory.cs
- unsafeIndexingFilterStream.cs
- XmlChildNodes.cs
- LoginCancelEventArgs.cs
- CodeDOMProvider.cs
- ComponentDispatcher.cs
- RegularExpressionValidator.cs
- ContextQuery.cs
- ObjectDataSourceEventArgs.cs
- streamingZipPartStream.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- ListBindingConverter.cs
- SQLInt32.cs
- RSAOAEPKeyExchangeFormatter.cs
- EncodingTable.cs
- RadialGradientBrush.cs
- SerializerDescriptor.cs
- ResolveNameEventArgs.cs
- OdbcError.cs
- PeerContact.cs
- PrimitiveCodeDomSerializer.cs
- LineGeometry.cs
- ArrayElementGridEntry.cs
- mongolianshape.cs
- CustomErrorsSectionWrapper.cs
- Version.cs
- TypeConverterHelper.cs
- DbExpressionVisitor_TResultType.cs
- ControllableStoryboardAction.cs
- ActivityScheduledQuery.cs
- GradientSpreadMethodValidation.cs
- GeneralTransformGroup.cs
- SchemaCollectionPreprocessor.cs
- XmlIncludeAttribute.cs
- ConfigurationValues.cs
- TypeName.cs
- ButtonBase.cs
- NativeMethodsOther.cs
- PageContentAsyncResult.cs
- Types.cs
- ComboBoxAutomationPeer.cs
- InfoCardArgumentException.cs
- _HTTPDateParse.cs
- DesignTableCollection.cs
- webproxy.cs
- HtmlSelect.cs
- StreamedWorkflowDefinitionContext.cs
- PnrpPermission.cs
- XmlEnumAttribute.cs
- SqlUtils.cs
- SqlLiftIndependentRowExpressions.cs
- IsolatedStorageException.cs
- XslCompiledTransform.cs
- Debugger.cs
- SessionState.cs
- UInt64Storage.cs
- SystemException.cs
- TraceListeners.cs
- ChildrenQuery.cs
- complextypematerializer.cs
- VirtualPath.cs
- X509ScopedServiceCertificateElementCollection.cs
- SingleTagSectionHandler.cs
- ImageMetadata.cs
- RegexFCD.cs
- HierarchicalDataBoundControl.cs
- ListBindableAttribute.cs
- MatrixTransform3D.cs
- FieldNameLookup.cs
- FormViewUpdatedEventArgs.cs
- HMACRIPEMD160.cs
- PngBitmapEncoder.cs
- Propagator.JoinPropagator.cs
- ContractComponent.cs
- HelpHtmlBuilder.cs
- SelectionItemPattern.cs
- OrderedDictionaryStateHelper.cs
- SemanticBasicElement.cs
- EncodingTable.cs
- VisualStyleRenderer.cs