Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Runtime / InteropServices / DispatchWrapper.cs / 1305376 / 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 { [System.Security.SecuritySafeCritical] // auto-generated [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 { [System.Security.SecuritySafeCritical] // auto-generated [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
- CodeTypeParameterCollection.cs
- TrackingProfileDeserializationException.cs
- CreatingCookieEventArgs.cs
- RadialGradientBrush.cs
- PropertyConverter.cs
- GlyphCache.cs
- ServiceDebugElement.cs
- ManagedWndProcTracker.cs
- TextContainerChangeEventArgs.cs
- TypeDelegator.cs
- HwndKeyboardInputProvider.cs
- CopyOfAction.cs
- UserControlAutomationPeer.cs
- ContainerParaClient.cs
- ProcessStartInfo.cs
- XmlAttributeAttribute.cs
- XmlCharType.cs
- DataGridToolTip.cs
- TextRangeSerialization.cs
- EncryptedXml.cs
- ButtonPopupAdapter.cs
- DatagridviewDisplayedBandsData.cs
- ImageCodecInfoPrivate.cs
- EventSourceCreationData.cs
- CompensationExtension.cs
- Style.cs
- DiscoveryEndpointValidator.cs
- TextEditorTyping.cs
- BinaryWriter.cs
- KeyNotFoundException.cs
- SecurityDocument.cs
- HttpListenerContext.cs
- ContainerParagraph.cs
- OptimalBreakSession.cs
- FlowDocumentPageViewerAutomationPeer.cs
- EpmSyndicationContentSerializer.cs
- DbConnectionStringCommon.cs
- NetworkStream.cs
- WebPartConnectVerb.cs
- HttpCachePolicy.cs
- SQLBytesStorage.cs
- ColorTranslator.cs
- AttributedMetaModel.cs
- Rotation3DAnimationUsingKeyFrames.cs
- StandardToolWindows.cs
- HandlerMappingMemo.cs
- CaseStatement.cs
- CachingHintValidation.cs
- IListConverters.cs
- FaultException.cs
- WindowsFormsSectionHandler.cs
- baseaxisquery.cs
- LinkDesigner.cs
- WindowsListViewItem.cs
- XslAstAnalyzer.cs
- MetadataCacheItem.cs
- Color.cs
- DataSpaceManager.cs
- HttpCacheVaryByContentEncodings.cs
- Merger.cs
- ContainsSearchOperator.cs
- SparseMemoryStream.cs
- QuotedPrintableStream.cs
- RoleManagerEventArgs.cs
- EUCJPEncoding.cs
- HandleScope.cs
- Int32Converter.cs
- WebPartMinimizeVerb.cs
- WebPartConnectionCollection.cs
- ResourceType.cs
- KnownTypes.cs
- ActivityBuilderHelper.cs
- ToolStripRenderer.cs
- Button.cs
- EventProviderBase.cs
- Overlapped.cs
- DefaultHttpHandler.cs
- XmlUTF8TextReader.cs
- TransactionBehavior.cs
- HashHelper.cs
- NativeObjectSecurity.cs
- HttpListenerContext.cs
- PeerTransportSecuritySettings.cs
- ScrollData.cs
- TimeSpanStorage.cs
- handlecollector.cs
- BulletDecorator.cs
- ModuleElement.cs
- PrimitiveDataContract.cs
- WebErrorHandler.cs
- ResourceKey.cs
- CharUnicodeInfo.cs
- XPathMultyIterator.cs
- AppDomainManager.cs
- SignatureDescription.cs
- PackageFilter.cs
- DefaultShape.cs
- OleDbConnectionFactory.cs
- OleDbParameterCollection.cs
- TextTreeTextElementNode.cs