Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / clr / src / BCL / System / Runtime / InteropServices / DispatchWrapper.cs / 1 / DispatchWrapper.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================================== ** ** Class: DispatchWrapper. ** ** ** Purpose: Wrapper that is converted to a variant with VT_DISPATCH. ** ** =============================================================================*/ namespace System.Runtime.InteropServices { using System; using System.Security; using System.Security.Permissions; [Serializable] [System.Runtime.InteropServices.ComVisible(true)] public sealed class DispatchWrapper { [SecurityPermissionAttribute(SecurityAction.Demand,Flags=SecurityPermissionFlag.UnmanagedCode)] public DispatchWrapper(Object obj) { if (obj != null) { // Make sure this guy has an IDispatch IntPtr pdisp = Marshal.GetIDispatchForObject(obj); // If we got here without throwing an exception, the QI for IDispatch succeeded. Marshal.Release(pdisp); } m_WrappedObject = obj; } public Object WrappedObject { get { return m_WrappedObject; } } private Object m_WrappedObject; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================================== ** ** Class: DispatchWrapper. ** ** ** Purpose: Wrapper that is converted to a variant with VT_DISPATCH. ** ** =============================================================================*/ namespace System.Runtime.InteropServices { using System; using System.Security; using System.Security.Permissions; [Serializable] [System.Runtime.InteropServices.ComVisible(true)] public sealed class DispatchWrapper { [SecurityPermissionAttribute(SecurityAction.Demand,Flags=SecurityPermissionFlag.UnmanagedCode)] public DispatchWrapper(Object obj) { if (obj != null) { // Make sure this guy has an IDispatch IntPtr pdisp = Marshal.GetIDispatchForObject(obj); // If we got here without throwing an exception, the QI for IDispatch succeeded. Marshal.Release(pdisp); } m_WrappedObject = obj; } public Object WrappedObject { get { return m_WrappedObject; } } private Object m_WrappedObject; } } // 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
- RelationshipType.cs
- VisualStyleTypesAndProperties.cs
- RIPEMD160Managed.cs
- ResXBuildProvider.cs
- DeferredElementTreeState.cs
- CharAnimationBase.cs
- VectorCollectionConverter.cs
- MdiWindowListItemConverter.cs
- SQLInt64.cs
- Pair.cs
- BitmapEffectOutputConnector.cs
- WSSecurityOneDotZeroSendSecurityHeader.cs
- GenericFlowSwitchHelper.cs
- HttpCookiesSection.cs
- BaseTreeIterator.cs
- MissingMemberException.cs
- NamedObject.cs
- NetCodeGroup.cs
- MatrixAnimationUsingKeyFrames.cs
- Unit.cs
- MatrixUtil.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- EntityDataSourceViewSchema.cs
- TogglePatternIdentifiers.cs
- Vector3DValueSerializer.cs
- FileChangesMonitor.cs
- DocumentXPathNavigator.cs
- SqlTypesSchemaImporter.cs
- AppLevelCompilationSectionCache.cs
- EventLogPermissionEntry.cs
- ObjectHandle.cs
- ProviderException.cs
- AccessDataSourceView.cs
- SecurityKeyIdentifierClause.cs
- ColumnMapVisitor.cs
- GenericEnumConverter.cs
- PreviousTrackingServiceAttribute.cs
- WebAdminConfigurationHelper.cs
- BoundsDrawingContextWalker.cs
- CustomCategoryAttribute.cs
- FormsAuthenticationTicket.cs
- ComponentTray.cs
- Hash.cs
- WebPartCollection.cs
- ThreadSafeList.cs
- SoapCodeExporter.cs
- SerialStream.cs
- CryptoApi.cs
- PartialCachingControl.cs
- DesignerLoader.cs
- StorageInfo.cs
- FixedDocumentPaginator.cs
- Timer.cs
- Marshal.cs
- XmlDeclaration.cs
- SizeLimitedCache.cs
- ArgumentValidation.cs
- IMembershipProvider.cs
- xdrvalidator.cs
- SHA256Managed.cs
- Window.cs
- ReflectionPermission.cs
- ConsumerConnectionPoint.cs
- Decimal.cs
- DbException.cs
- DeclarationUpdate.cs
- SQLInt32.cs
- SendMessageContent.cs
- ExpandedProjectionNode.cs
- UserControl.cs
- WizardStepBase.cs
- ButtonField.cs
- SystemIPv4InterfaceProperties.cs
- GatewayIPAddressInformationCollection.cs
- CodeDirectoryCompiler.cs
- complextypematerializer.cs
- ApplicationDirectory.cs
- TrustManagerMoreInformation.cs
- BlurEffect.cs
- ReflectionHelper.cs
- Compiler.cs
- SafeCertificateStore.cs
- SafeRightsManagementSessionHandle.cs
- WebPartCatalogAddVerb.cs
- SubclassTypeValidator.cs
- CheckPair.cs
- RSAPKCS1KeyExchangeFormatter.cs
- exports.cs
- IssuedTokenClientCredential.cs
- HttpCookiesSection.cs
- ProfileSettings.cs
- BindableAttribute.cs
- ToolStripGripRenderEventArgs.cs
- DrawingImage.cs
- ToolStripItemRenderEventArgs.cs
- GPRECT.cs
- EventRecord.cs
- TextChangedEventArgs.cs
- WebServiceEnumData.cs
- StateMachine.cs