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
- MaterialGroup.cs
- SessionEndingEventArgs.cs
- _ListenerResponseStream.cs
- EntityEntry.cs
- DispatcherTimer.cs
- EntityStoreSchemaGenerator.cs
- unsafenativemethodstextservices.cs
- XmlUnspecifiedAttribute.cs
- DiscoveryUtility.cs
- StateMachine.cs
- XmlValidatingReader.cs
- EditCommandColumn.cs
- RequestCachePolicy.cs
- OleDbConnection.cs
- XmlDomTextWriter.cs
- CodeIdentifiers.cs
- ModifierKeysValueSerializer.cs
- MetaColumn.cs
- UIAgentRequest.cs
- HitTestDrawingContextWalker.cs
- MenuItemAutomationPeer.cs
- XmlMtomReader.cs
- TextBoxBase.cs
- BaseDataListComponentEditor.cs
- CodeTypeDeclaration.cs
- OpenFileDialog.cs
- ConstantExpression.cs
- ToolCreatedEventArgs.cs
- CommonObjectSecurity.cs
- TdsParser.cs
- MultipartContentParser.cs
- NameTable.cs
- PrimitiveXmlSerializers.cs
- CounterCreationDataCollection.cs
- AnimationClockResource.cs
- UrlPropertyAttribute.cs
- Cell.cs
- ReferenceConverter.cs
- DoubleMinMaxAggregationOperator.cs
- ClrProviderManifest.cs
- PrimitiveType.cs
- ComboBox.cs
- RemoteDebugger.cs
- RegexStringValidatorAttribute.cs
- SqlBulkCopy.cs
- DBAsyncResult.cs
- StyleSheetRefUrlEditor.cs
- AsymmetricSignatureDeformatter.cs
- UTF7Encoding.cs
- ThreadSafeList.cs
- XmlExpressionDumper.cs
- OdbcConnectionPoolProviderInfo.cs
- RadioButton.cs
- ResourceReferenceExpressionConverter.cs
- MappingException.cs
- Manipulation.cs
- IdentifierService.cs
- XmlMtomReader.cs
- MsmqIntegrationSecurity.cs
- Int32EqualityComparer.cs
- XmlEncodedRawTextWriter.cs
- InterleavedZipPartStream.cs
- SecureEnvironment.cs
- RecognizedWordUnit.cs
- AsyncResult.cs
- JsonMessageEncoderFactory.cs
- AppLevelCompilationSectionCache.cs
- TargetParameterCountException.cs
- DataGridViewRowConverter.cs
- TagPrefixInfo.cs
- TextEffect.cs
- DispatchWrapper.cs
- RtType.cs
- SoapAttributeOverrides.cs
- DataGridTablesFactory.cs
- DataReceivedEventArgs.cs
- DbMetaDataFactory.cs
- LineInfo.cs
- OutputCacheSettingsSection.cs
- MenuAutomationPeer.cs
- DesignerVerbCollection.cs
- VarRefManager.cs
- HtmlShimManager.cs
- FixedBufferAttribute.cs
- sqlpipe.cs
- Quaternion.cs
- StringInfo.cs
- Vector3DCollection.cs
- EtwTrackingBehavior.cs
- UnsafeCollabNativeMethods.cs
- ContainerUIElement3D.cs
- ReadOnlyDataSourceView.cs
- BamlBinaryReader.cs
- XsdDuration.cs
- HwndTarget.cs
- WorkflowExecutor.cs
- DataView.cs
- DataFormats.cs
- RequestContext.cs
- IpcChannelHelper.cs