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
- XmlDictionary.cs
- AnnotationHighlightLayer.cs
- QueryReaderSettings.cs
- PropertyTabAttribute.cs
- PriorityBindingExpression.cs
- AspNetSynchronizationContext.cs
- DefaultTextStore.cs
- TemplatePartAttribute.cs
- Rectangle.cs
- COM2ColorConverter.cs
- ExtensionFile.cs
- WebPartAuthorizationEventArgs.cs
- AttachInfo.cs
- BuildProviderUtils.cs
- Cursors.cs
- Operator.cs
- WindowHideOrCloseTracker.cs
- EventProviderWriter.cs
- RemoteTokenFactory.cs
- SafeTimerHandle.cs
- Fx.cs
- XmlNamespaceManager.cs
- EventLog.cs
- StrongNameIdentityPermission.cs
- CryptographicAttribute.cs
- SqlNotificationRequest.cs
- Color.cs
- bidPrivateBase.cs
- SortKey.cs
- WindowsTreeView.cs
- DispatchWrapper.cs
- SwitchElementsCollection.cs
- OdbcUtils.cs
- DecoderExceptionFallback.cs
- GridViewRowEventArgs.cs
- filewebresponse.cs
- ProviderCommandInfoUtils.cs
- DoubleCollectionValueSerializer.cs
- LineInfo.cs
- NotSupportedException.cs
- MemberInfoSerializationHolder.cs
- ConnectivityStatus.cs
- ColorIndependentAnimationStorage.cs
- ConfigurationConverterBase.cs
- WindowsScroll.cs
- BitSet.cs
- DefaultAssemblyResolver.cs
- httpserverutility.cs
- DbExpressionRules.cs
- DbInsertCommandTree.cs
- EmbeddedMailObject.cs
- XmlIlVisitor.cs
- CompoundFileStreamReference.cs
- CompilerInfo.cs
- EntityClassGenerator.cs
- PropertyConverter.cs
- TraceContextRecord.cs
- StickyNoteAnnotations.cs
- AsyncContentLoadedEventArgs.cs
- ControlSerializer.cs
- SharedStatics.cs
- GACMembershipCondition.cs
- bindurihelper.cs
- SqlDataSourceSelectingEventArgs.cs
- GridViewColumnCollectionChangedEventArgs.cs
- ReflectionUtil.cs
- LexicalChunk.cs
- _ConnectStream.cs
- RequestCachePolicyConverter.cs
- ObjectManager.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- InfoCardHelper.cs
- ChildChangedEventArgs.cs
- ConfigUtil.cs
- SqlBuilder.cs
- LicenseContext.cs
- Buffer.cs
- Vertex.cs
- ProfileGroupSettingsCollection.cs
- EntitySetRetriever.cs
- ApplicationFileCodeDomTreeGenerator.cs
- BinarySecretKeyIdentifierClause.cs
- RepeaterItemEventArgs.cs
- AttachedAnnotation.cs
- PermissionRequestEvidence.cs
- SqlBinder.cs
- webbrowsersite.cs
- ProfileManager.cs
- ChtmlCalendarAdapter.cs
- DurationConverter.cs
- ErrorItem.cs
- DataGridViewCellStateChangedEventArgs.cs
- HttpListenerContext.cs
- RegexCharClass.cs
- SqlClientMetaDataCollectionNames.cs
- NativeObjectSecurity.cs
- CustomBindingElementCollection.cs
- DocumentReferenceCollection.cs
- SqlMethodCallConverter.cs
- QilReference.cs