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
- objectquery_tresulttype.cs
- WsatServiceCertificate.cs
- FormsAuthenticationCredentials.cs
- ImageBrush.cs
- ContextStaticAttribute.cs
- ComponentRenameEvent.cs
- AutomationProperties.cs
- ProtectedConfigurationSection.cs
- SqlHelper.cs
- documentsequencetextpointer.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- FixedSOMTable.cs
- MetabaseServerConfig.cs
- TransactionsSectionGroup.cs
- XmlSerializableWriter.cs
- RuleSettings.cs
- DoubleLink.cs
- FixedSOMPageElement.cs
- TextComposition.cs
- BitmapVisualManager.cs
- LineBreak.cs
- WbemProvider.cs
- HwndAppCommandInputProvider.cs
- DbConnectionStringCommon.cs
- Attributes.cs
- ConfigurationPropertyCollection.cs
- SocketInformation.cs
- RelationalExpressions.cs
- LayoutTable.cs
- PlanCompiler.cs
- HelpKeywordAttribute.cs
- ClickablePoint.cs
- ContainerSelectorActiveEvent.cs
- lengthconverter.cs
- PermissionSetEnumerator.cs
- SerialErrors.cs
- ConfigurationStrings.cs
- Base64Decoder.cs
- Mutex.cs
- StateWorkerRequest.cs
- RenderingBiasValidation.cs
- CompModSwitches.cs
- PropertyDescriptorCollection.cs
- UIElementPropertyUndoUnit.cs
- _TimerThread.cs
- BitmapPalettes.cs
- EventBuilder.cs
- HttpProfileGroupBase.cs
- SafeRightsManagementEnvironmentHandle.cs
- COM2TypeInfoProcessor.cs
- DataGridViewColumnEventArgs.cs
- UITypeEditor.cs
- ClipboardData.cs
- ToolStripDropTargetManager.cs
- TimeSpan.cs
- MatrixUtil.cs
- WindowsFormsSectionHandler.cs
- InstanceView.cs
- ListDictionaryInternal.cs
- XmlRootAttribute.cs
- ValueProviderWrapper.cs
- XPathAncestorIterator.cs
- RelatedView.cs
- MetadataArtifactLoaderFile.cs
- ToolBarButtonDesigner.cs
- SortQueryOperator.cs
- SqlMethods.cs
- TemplatePagerField.cs
- XPathDocument.cs
- DataKey.cs
- ExitEventArgs.cs
- XmlAtomicValue.cs
- BuildDependencySet.cs
- SqlBooleanMismatchVisitor.cs
- KeyGestureConverter.cs
- UnitySerializationHolder.cs
- Stack.cs
- SQlBooleanStorage.cs
- Internal.cs
- Config.cs
- SafeRightsManagementQueryHandle.cs
- ThreadExceptionDialog.cs
- DependencyPropertyConverter.cs
- Rectangle.cs
- dbenumerator.cs
- TraceInternal.cs
- ChangePassword.cs
- ObjectHandle.cs
- XmlIlTypeHelper.cs
- Size.cs
- ColorKeyFrameCollection.cs
- Wrapper.cs
- HtmlTableRowCollection.cs
- SwitchAttribute.cs
- SchemaComplexType.cs
- ISO2022Encoding.cs
- SqlCacheDependencyDatabase.cs
- HotSpot.cs
- SqlTriggerContext.cs
- TreeNodeCollection.cs