Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Runtime / InteropServices / ErrorWrapper.cs / 1305376 / 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; } [System.Security.SecuritySafeCritical] // auto-generated [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; } [System.Security.SecuritySafeCritical] // auto-generated [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
- MetadataArtifactLoaderCompositeFile.cs
- FrameworkContentElement.cs
- PageBreakRecord.cs
- Thread.cs
- ChangeBlockUndoRecord.cs
- SqlDependency.cs
- ToolStripItemEventArgs.cs
- ActiveXHelper.cs
- MarkupExtensionParser.cs
- GridViewColumnHeaderAutomationPeer.cs
- OneToOneMappingSerializer.cs
- KeyValueInternalCollection.cs
- MULTI_QI.cs
- Tool.cs
- CredentialCache.cs
- CodeDirectionExpression.cs
- Track.cs
- GetPageCompletedEventArgs.cs
- DataControlFieldCell.cs
- MarkupProperty.cs
- ListView.cs
- NavigateEvent.cs
- SiteMapSection.cs
- SingleKeyFrameCollection.cs
- SmtpException.cs
- MailHeaderInfo.cs
- FacetValueContainer.cs
- MenuItemStyleCollection.cs
- Panel.cs
- dataobject.cs
- PermissionSetEnumerator.cs
- ExpressionPrinter.cs
- DbCommandDefinition.cs
- DefinitionUpdate.cs
- ResourceProviderFactory.cs
- OletxVolatileEnlistment.cs
- COM2IPerPropertyBrowsingHandler.cs
- AttributeEmitter.cs
- Behavior.cs
- AuthenticationModuleElement.cs
- SqlClientFactory.cs
- SigningCredentials.cs
- QuotedPrintableStream.cs
- RtType.cs
- XmlDocumentType.cs
- ConfigurationManagerInternalFactory.cs
- HitTestResult.cs
- XomlCompilerError.cs
- HttpApplication.cs
- ServiceCredentials.cs
- LocalizationParserHooks.cs
- MetabaseSettings.cs
- BitmapDownload.cs
- ExecutionEngineException.cs
- Avt.cs
- TextTreeUndoUnit.cs
- TextElement.cs
- DBSqlParser.cs
- InternalMappingException.cs
- TraceFilter.cs
- ExpandoObject.cs
- FileDialogPermission.cs
- localization.cs
- DurableInstanceProvider.cs
- BindingWorker.cs
- LogFlushAsyncResult.cs
- HttpWriter.cs
- dataprotectionpermission.cs
- VariableDesigner.xaml.cs
- FileAuthorizationModule.cs
- Stack.cs
- HitTestResult.cs
- PageStatePersister.cs
- ServiceInstallComponent.cs
- BStrWrapper.cs
- SimpleExpression.cs
- PeerEndPoint.cs
- WindowManager.cs
- SizeChangedEventArgs.cs
- ReadOnlyHierarchicalDataSource.cs
- CollectionBuilder.cs
- DbConnectionPoolGroupProviderInfo.cs
- SafeCryptoKeyHandle.cs
- MemberHolder.cs
- WebPartExportVerb.cs
- DnsElement.cs
- BindingsCollection.cs
- CommandEventArgs.cs
- UnionCqlBlock.cs
- StoragePropertyMapping.cs
- ResXFileRef.cs
- _FtpControlStream.cs
- ContractCodeDomInfo.cs
- MeasureData.cs
- FixUpCollection.cs
- HwndHost.cs
- PlanCompilerUtil.cs
- InstanceOwnerException.cs
- CatalogPartChrome.cs
- ContextMenu.cs