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
- IconHelper.cs
- CompressedStack.cs
- SqlTriggerContext.cs
- WebPartUtil.cs
- ClientRuntime.cs
- Point3DAnimationBase.cs
- DependencyObjectType.cs
- SpecialFolderEnumConverter.cs
- PointUtil.cs
- autovalidator.cs
- XmlSchemaAnnotated.cs
- WinEventHandler.cs
- SerializerDescriptor.cs
- SiteMapDataSource.cs
- DecoderBestFitFallback.cs
- Function.cs
- DataGridTablesFactory.cs
- PingOptions.cs
- CacheVirtualItemsEvent.cs
- Themes.cs
- SendingRequestEventArgs.cs
- ThemeableAttribute.cs
- metrodevice.cs
- Utilities.cs
- ScriptResourceInfo.cs
- StylusPointPropertyInfoDefaults.cs
- BasePattern.cs
- TraceEventCache.cs
- OrElse.cs
- AliasGenerator.cs
- Converter.cs
- WebPartMinimizeVerb.cs
- HtmlWindow.cs
- PrintDialog.cs
- MemberRelationshipService.cs
- TemplateInstanceAttribute.cs
- XmlSchemaSimpleType.cs
- CatalogPart.cs
- HttpTransportManager.cs
- DataContractSerializerOperationBehavior.cs
- ImageMapEventArgs.cs
- OrderToken.cs
- VariableAction.cs
- XmlReader.cs
- OdbcHandle.cs
- mediapermission.cs
- BamlLocalizableResource.cs
- OverflowException.cs
- PeerCollaboration.cs
- VariableValue.cs
- _AutoWebProxyScriptEngine.cs
- OdbcRowUpdatingEvent.cs
- PropertyTabAttribute.cs
- DiscoveryClientOutputChannel.cs
- XmlSchemaObjectCollection.cs
- ConstrainedGroup.cs
- Drawing.cs
- StringCollectionMarkupSerializer.cs
- CodeTypeReference.cs
- PasswordBoxAutomationPeer.cs
- ComponentChangedEvent.cs
- PropertyItemInternal.cs
- RemotingSurrogateSelector.cs
- StdRegProviderWrapper.cs
- ToolStripSplitStackLayout.cs
- SoapIncludeAttribute.cs
- CodeChecksumPragma.cs
- PipeStream.cs
- SiteMapDataSourceView.cs
- WebPartConnectionsCloseVerb.cs
- SqlClientWrapperSmiStream.cs
- EntityConnectionStringBuilder.cs
- LocalizableAttribute.cs
- AssociationTypeEmitter.cs
- DependencyPropertyKey.cs
- initElementDictionary.cs
- ConfigurationSectionGroupCollection.cs
- KnownTypesProvider.cs
- DiagnosticsConfiguration.cs
- Paragraph.cs
- DataGridViewColumnStateChangedEventArgs.cs
- CodeDOMProvider.cs
- dbenumerator.cs
- WebSysDefaultValueAttribute.cs
- Visual.cs
- ExceptionRoutedEventArgs.cs
- DataGridViewCheckBoxColumn.cs
- DmlSqlGenerator.cs
- WindowsIdentity.cs
- ColorAnimationUsingKeyFrames.cs
- Package.cs
- InputGestureCollection.cs
- OleDbSchemaGuid.cs
- WebSysDisplayNameAttribute.cs
- RedistVersionInfo.cs
- ConstraintConverter.cs
- View.cs
- WindowsStartMenu.cs
- MaskedTextBox.cs
- XComponentModel.cs