Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- DBCommandBuilder.cs
- SoapInteropTypes.cs
- HtmlFormWrapper.cs
- SqlMethodCallConverter.cs
- IdentifierService.cs
- DefaultTraceListener.cs
- PropertyDescriptorCollection.cs
- GridViewColumnCollectionChangedEventArgs.cs
- Metadata.cs
- Token.cs
- CopyNodeSetAction.cs
- BatchParser.cs
- PolicyUnit.cs
- DoubleCollectionConverter.cs
- ActiveXHost.cs
- TextTreeRootTextBlock.cs
- SemanticBasicElement.cs
- PrimitiveCodeDomSerializer.cs
- FacetEnabledSchemaElement.cs
- WeakHashtable.cs
- EncryptedPackageFilter.cs
- BidPrivateBase.cs
- AnimationClock.cs
- ObjectDataSourceMethodEventArgs.cs
- ConfigurationElementProperty.cs
- TypeGeneratedEventArgs.cs
- COMException.cs
- ReadOnlyDictionary.cs
- IndexOutOfRangeException.cs
- ListItemCollection.cs
- Cursors.cs
- DocumentReferenceCollection.cs
- InputLanguageCollection.cs
- WebPartMenu.cs
- CodeIdentifiers.cs
- LocalBuilder.cs
- AnnotationAuthorChangedEventArgs.cs
- SafeNativeMethods.cs
- BindingExpression.cs
- QueryRewriter.cs
- RankException.cs
- Models.cs
- CssClassPropertyAttribute.cs
- ProfileEventArgs.cs
- ProgressBar.cs
- DefaultCommandExtensionCallback.cs
- UnsafeNativeMethods.cs
- XPathDocumentIterator.cs
- MessageSecurityOverTcpElement.cs
- ExpressionBindings.cs
- ParameterEditorUserControl.cs
- MetadataHelper.cs
- GridViewColumn.cs
- SignatureToken.cs
- ChangeTracker.cs
- PersistenceTypeAttribute.cs
- NativeBuffer.cs
- Dispatcher.cs
- UpdateDelegates.Generated.cs
- FileDataSourceCache.cs
- ProxyManager.cs
- RowsCopiedEventArgs.cs
- Models.cs
- OperandQuery.cs
- CommandLineParser.cs
- PasswordBoxAutomationPeer.cs
- ImageList.cs
- SqlWriter.cs
- SubpageParagraph.cs
- DataGridViewTextBoxColumn.cs
- Perspective.cs
- ArrayConverter.cs
- MobileCapabilities.cs
- VisualTreeHelper.cs
- While.cs
- MissingManifestResourceException.cs
- ObjectDesignerDataSourceView.cs
- CacheMemory.cs
- PerfCounterSection.cs
- SamlAuthenticationStatement.cs
- StylusShape.cs
- DeviceContext.cs
- QilTernary.cs
- TypeForwardedFromAttribute.cs
- TimerEventSubscription.cs
- Context.cs
- UnconditionalPolicy.cs
- TableRowCollection.cs
- ScriptComponentDescriptor.cs
- XmlCountingReader.cs
- Point3DKeyFrameCollection.cs
- MetadataImporterQuotas.cs
- cookie.cs
- NativeMethods.cs
- TdsParserHelperClasses.cs
- NativeCompoundFileAPIs.cs
- Span.cs
- MissingManifestResourceException.cs
- UIntPtr.cs
- TextAutomationPeer.cs