Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- MimeWriter.cs
- ToggleButton.cs
- Annotation.cs
- ApplicationActivator.cs
- Focus.cs
- TypeExtension.cs
- ZipIOExtraFieldPaddingElement.cs
- HtmlInputPassword.cs
- TabItemAutomationPeer.cs
- ExpressionVisitor.cs
- IxmlLineInfo.cs
- HttpResponse.cs
- PartitionResolver.cs
- XamlToRtfWriter.cs
- AttachedPropertyMethodSelector.cs
- CultureInfoConverter.cs
- VirtualPath.cs
- UIHelper.cs
- WebPartVerbsEventArgs.cs
- TargetPerspective.cs
- OracleMonthSpan.cs
- EditorBrowsableAttribute.cs
- WorkflowServiceHostFactory.cs
- WaitHandleCannotBeOpenedException.cs
- SqlXml.cs
- SerializationEventsCache.cs
- input.cs
- ErrorStyle.cs
- PopupControlService.cs
- SpinWait.cs
- UpdatePanelControlTrigger.cs
- Soap12ProtocolImporter.cs
- LinqDataSourceEditData.cs
- Automation.cs
- DesignerCatalogPartChrome.cs
- DataRowExtensions.cs
- IdnElement.cs
- OledbConnectionStringbuilder.cs
- ThreadExceptionEvent.cs
- ClaimTypeElement.cs
- _HTTPDateParse.cs
- DropShadowBitmapEffect.cs
- Graph.cs
- PTUtility.cs
- InputManager.cs
- ComponentEditorForm.cs
- Freezable.cs
- RtType.cs
- HtmlWindowCollection.cs
- TypeInitializationException.cs
- ContractNamespaceAttribute.cs
- NativeCppClassAttribute.cs
- HwndTarget.cs
- HashRepartitionStream.cs
- SubMenuStyleCollectionEditor.cs
- MultiBindingExpression.cs
- MouseDevice.cs
- PlainXmlDeserializer.cs
- ColorKeyFrameCollection.cs
- PtsCache.cs
- TreeNodeStyleCollection.cs
- BindingWorker.cs
- KeyMatchBuilder.cs
- SHA512.cs
- Empty.cs
- PrivacyNoticeBindingElementImporter.cs
- Transform.cs
- TransformGroup.cs
- XmlNamespaceDeclarationsAttribute.cs
- PrivilegeNotHeldException.cs
- DelegateArgument.cs
- DesignerWidgets.cs
- BindingValueChangedEventArgs.cs
- StaticDataManager.cs
- DBProviderConfigurationHandler.cs
- XmlSchemaExternal.cs
- DependencyPropertyDescriptor.cs
- TimeSpanMinutesConverter.cs
- ElementNotEnabledException.cs
- WebException.cs
- RequestCacheValidator.cs
- MatrixTransform3D.cs
- NullableBoolConverter.cs
- StorageComplexPropertyMapping.cs
- TraceUtility.cs
- WindowsRebar.cs
- COAUTHINFO.cs
- DataGridViewRowsRemovedEventArgs.cs
- ItemsChangedEventArgs.cs
- ServiceParser.cs
- QueryCacheEntry.cs
- MultipartContentParser.cs
- PropertyToken.cs
- MatcherBuilder.cs
- Select.cs
- DataServiceQueryProvider.cs
- OracleEncoding.cs
- ParameterToken.cs
- OleAutBinder.cs
- DetailsViewInsertedEventArgs.cs