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
- ImpersonateTokenRef.cs
- IItemContainerGenerator.cs
- XhtmlBasicPanelAdapter.cs
- ValidationHelper.cs
- ObfuscateAssemblyAttribute.cs
- DropShadowEffect.cs
- StateDesigner.LayoutSelectionGlyph.cs
- PhysicalAddress.cs
- FamilyTypefaceCollection.cs
- MemberAssignmentAnalysis.cs
- OleDbConnectionInternal.cs
- OleDbWrapper.cs
- SafeNativeHandle.cs
- ScrollPatternIdentifiers.cs
- DependencyObjectPropertyDescriptor.cs
- assemblycache.cs
- _UriSyntax.cs
- CatchBlock.cs
- NavigatorInput.cs
- ProcessInputEventArgs.cs
- ThreadStateException.cs
- HtmlInputButton.cs
- DelegatedStream.cs
- EdmRelationshipRoleAttribute.cs
- BatchWriter.cs
- ToolStripContentPanelDesigner.cs
- ChannelEndpointElement.cs
- MessageQueueKey.cs
- ValueUnavailableException.cs
- SessionEndingCancelEventArgs.cs
- PackagePartCollection.cs
- PopupRoot.cs
- SimplePropertyEntry.cs
- CodeAttributeArgumentCollection.cs
- XmlNodeChangedEventArgs.cs
- StringComparer.cs
- ColorBlend.cs
- GraphicsPathIterator.cs
- ContentValidator.cs
- TypeValidationEventArgs.cs
- ByteStreamMessageEncoder.cs
- TypefaceMetricsCache.cs
- TemplatedAdorner.cs
- BufferedWebEventProvider.cs
- PixelFormat.cs
- PersonalizationAdministration.cs
- WsatConfiguration.cs
- CodeMethodReturnStatement.cs
- _LocalDataStoreMgr.cs
- DefaultTextStore.cs
- WorkflowEventArgs.cs
- BooleanProjectedSlot.cs
- ComboBox.cs
- AttachedPropertyDescriptor.cs
- SchemaTypeEmitter.cs
- BamlCollectionHolder.cs
- DesignerAttribute.cs
- ServiceBuildProvider.cs
- AmbientLight.cs
- SqlConnectionStringBuilder.cs
- SqlMethodTransformer.cs
- OleServicesContext.cs
- SHA512.cs
- FontStretchConverter.cs
- MenuAdapter.cs
- VirtualizedContainerService.cs
- WindowsRegion.cs
- ListViewHitTestInfo.cs
- HttpCookiesSection.cs
- _NestedMultipleAsyncResult.cs
- SqlDuplicator.cs
- ObjectDesignerDataSourceView.cs
- CqlQuery.cs
- EntityDesignerUtils.cs
- RowBinding.cs
- MsdtcClusterUtils.cs
- ContainerFilterService.cs
- InternalCache.cs
- SafeFileMappingHandle.cs
- HttpCapabilitiesSectionHandler.cs
- FilterableAttribute.cs
- StaticDataManager.cs
- TextRangeSerialization.cs
- FillRuleValidation.cs
- ExpressionBuilderContext.cs
- webeventbuffer.cs
- MiniConstructorInfo.cs
- DBConcurrencyException.cs
- DataGridAutoGeneratingColumnEventArgs.cs
- Random.cs
- Form.cs
- DBNull.cs
- DataGridViewCellStyleBuilderDialog.cs
- ContainerUIElement3D.cs
- Separator.cs
- WebHostUnsafeNativeMethods.cs
- AtomParser.cs
- DataList.cs
- SrgsRule.cs
- GrammarBuilderWildcard.cs