Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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; } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FirstMatchCodeGroup.cs
- DataControlCommands.cs
- StyleTypedPropertyAttribute.cs
- EdmComplexPropertyAttribute.cs
- LinearQuaternionKeyFrame.cs
- BitmapSource.cs
- ObjectDataSourceChooseMethodsPanel.cs
- HttpVersion.cs
- NativeMsmqMessage.cs
- XmlImplementation.cs
- DataPager.cs
- Margins.cs
- OleDbRowUpdatedEvent.cs
- UnsafeNativeMethods.cs
- Int64Storage.cs
- SplayTreeNode.cs
- FormViewDeleteEventArgs.cs
- StrongTypingException.cs
- XmlIgnoreAttribute.cs
- ForeignConstraint.cs
- DirectionalLight.cs
- Nullable.cs
- COM2ExtendedBrowsingHandler.cs
- VirtualPathProvider.cs
- HtmlMeta.cs
- ImageMap.cs
- XmlWhitespace.cs
- WindowShowOrOpenTracker.cs
- BinaryParser.cs
- ImageList.cs
- ArrayItemReference.cs
- ContentPlaceHolder.cs
- DataTableNewRowEvent.cs
- ActionNotSupportedException.cs
- DynamicDataResources.Designer.cs
- DataRelationPropertyDescriptor.cs
- OperationPerformanceCounters.cs
- CanExecuteRoutedEventArgs.cs
- SQLGuidStorage.cs
- SafeBuffer.cs
- TableParagraph.cs
- DataColumnChangeEvent.cs
- userdatakeys.cs
- Triangle.cs
- OptimalTextSource.cs
- ZipIOLocalFileDataDescriptor.cs
- DetailsViewDeleteEventArgs.cs
- Compiler.cs
- PointHitTestParameters.cs
- CommandField.cs
- NaturalLanguageHyphenator.cs
- SchemaLookupTable.cs
- DetectEofStream.cs
- NullRuntimeConfig.cs
- FragmentQuery.cs
- XmlEntityReference.cs
- PagedDataSource.cs
- Validator.cs
- ControlCachePolicy.cs
- KnownBoxes.cs
- MetabaseSettings.cs
- XPathExpr.cs
- UIElement3D.cs
- TemporaryBitmapFile.cs
- ContentWrapperAttribute.cs
- KeyConverter.cs
- HtmlShimManager.cs
- CodeChecksumPragma.cs
- SiteMapNodeItemEventArgs.cs
- UnhandledExceptionEventArgs.cs
- DefaultTextStore.cs
- HwndSourceKeyboardInputSite.cs
- Application.cs
- UndoManager.cs
- WindowsSolidBrush.cs
- DiscoveryClientOutputChannel.cs
- EntityDesignerUtils.cs
- BaseValidator.cs
- TypeConvertions.cs
- DynamicResourceExtension.cs
- ButtonBaseAutomationPeer.cs
- columnmapkeybuilder.cs
- ActivityInstance.cs
- Convert.cs
- NavigationCommands.cs
- AppDomainFactory.cs
- XPathSingletonIterator.cs
- XmlWriterSettings.cs
- EntityClientCacheKey.cs
- DataGridRowsPresenter.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- PrintControllerWithStatusDialog.cs
- latinshape.cs
- ActivationArguments.cs
- ExtensionSimplifierMarkupObject.cs
- WebPartTransformer.cs
- DataSet.cs
- SerializationFieldInfo.cs
- DataServiceClientException.cs
- ACE.cs