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
- BinaryWriter.cs
- OrderedParallelQuery.cs
- RayMeshGeometry3DHitTestResult.cs
- DataBinding.cs
- ConstraintStruct.cs
- CacheSection.cs
- MethodBody.cs
- FieldDescriptor.cs
- SqlBulkCopyColumnMappingCollection.cs
- DeviceFilterDictionary.cs
- CounterCreationDataConverter.cs
- Cursors.cs
- DoubleLinkList.cs
- PublisherMembershipCondition.cs
- ErrorRuntimeConfig.cs
- SpecularMaterial.cs
- CompilerCollection.cs
- NativeObjectSecurity.cs
- DbConnectionPoolIdentity.cs
- FilterableAttribute.cs
- SchemaElementLookUpTable.cs
- PageCache.cs
- DesignTimeData.cs
- TextFormatterHost.cs
- sitestring.cs
- ExpressionVisitor.cs
- PageStatePersister.cs
- AttachedPropertyBrowsableAttribute.cs
- WebPartVerbsEventArgs.cs
- UnsafeNativeMethods.cs
- ByteStack.cs
- MaterializeFromAtom.cs
- QilStrConcat.cs
- ContactManager.cs
- _ChunkParse.cs
- TextAutomationPeer.cs
- QueryCacheManager.cs
- ClientProxyGenerator.cs
- namescope.cs
- ConversionContext.cs
- HijriCalendar.cs
- HtmlInputCheckBox.cs
- ResourceType.cs
- PlainXmlDeserializer.cs
- PagedDataSource.cs
- PrivacyNoticeBindingElement.cs
- CssClassPropertyAttribute.cs
- TypeInfo.cs
- ImmutableObjectAttribute.cs
- Exceptions.cs
- ClockController.cs
- PropertyChangedEventManager.cs
- XmlSignatureProperties.cs
- IisTraceListener.cs
- FlowDocumentPaginator.cs
- Soap.cs
- GeneralTransform3D.cs
- ImageButton.cs
- DetailsViewModeEventArgs.cs
- XPathAncestorQuery.cs
- SizeAnimation.cs
- StateFinalizationDesigner.cs
- ServiceModelActivationSectionGroup.cs
- UserControlAutomationPeer.cs
- SHA256Managed.cs
- FixUp.cs
- BuilderPropertyEntry.cs
- TabControl.cs
- NamespaceList.cs
- DigitShape.cs
- URLIdentityPermission.cs
- DragEventArgs.cs
- WithParamAction.cs
- XmlDocumentFragment.cs
- FormatterConverter.cs
- DataServiceRequest.cs
- UIPermission.cs
- Storyboard.cs
- CallContext.cs
- XomlCompilerHelpers.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- SystemResources.cs
- FixedBufferAttribute.cs
- RegexNode.cs
- LayoutEvent.cs
- CellTreeNode.cs
- StylusButton.cs
- ReturnType.cs
- HtmlInputReset.cs
- LinqDataSourceValidationException.cs
- RemotingService.cs
- TypeForwardedToAttribute.cs
- DrawingAttributeSerializer.cs
- HtmlInputButton.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- PreProcessInputEventArgs.cs
- XPathDescendantIterator.cs
- ReceiveSecurityHeaderElementManager.cs
- CodeDOMProvider.cs
- Viewport3DVisual.cs