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
- HttpRequestCacheValidator.cs
- SessionPageStatePersister.cs
- IMembershipProvider.cs
- GrammarBuilderPhrase.cs
- ThreadAttributes.cs
- StringUtil.cs
- DebugInfoGenerator.cs
- ProtectedProviderSettings.cs
- ExpressionBuilder.cs
- SQLByte.cs
- DtdParser.cs
- ListViewItem.cs
- IsolatedStorageFileStream.cs
- SafePEFileHandle.cs
- PointCollectionConverter.cs
- HotSpotCollection.cs
- FamilyCollection.cs
- PeerNameRegistration.cs
- EncryptedPackage.cs
- TemplateComponentConnector.cs
- TextDecorationCollection.cs
- TablePatternIdentifiers.cs
- Pair.cs
- BinHexEncoder.cs
- KoreanCalendar.cs
- LiteralTextContainerControlBuilder.cs
- CollectionViewGroupRoot.cs
- DoubleAnimationUsingKeyFrames.cs
- XPathDocumentBuilder.cs
- SpeechEvent.cs
- DecoderFallback.cs
- LineInfo.cs
- ArglessEventHandlerProxy.cs
- isolationinterop.cs
- CodeDefaultValueExpression.cs
- InvokePattern.cs
- dtdvalidator.cs
- Annotation.cs
- CheckBoxAutomationPeer.cs
- AutomationEvent.cs
- Cell.cs
- RelationshipSet.cs
- StylusDevice.cs
- Misc.cs
- WebRequestModuleElementCollection.cs
- SqlComparer.cs
- WebBrowserHelper.cs
- WebPartEditorApplyVerb.cs
- WsdlBuildProvider.cs
- CommonObjectSecurity.cs
- IdnElement.cs
- ExecutedRoutedEventArgs.cs
- MediaScriptCommandRoutedEventArgs.cs
- EventProviderTraceListener.cs
- MemberExpression.cs
- UpWmlPageAdapter.cs
- LinqTreeNodeEvaluator.cs
- ListParagraph.cs
- UrlAuthorizationModule.cs
- OracleDataAdapter.cs
- StreamAsIStream.cs
- PathFigure.cs
- XmlDocumentSerializer.cs
- Guid.cs
- ClientTarget.cs
- Size3D.cs
- ScrollViewer.cs
- ProcessModuleCollection.cs
- EntityDataSourceUtil.cs
- ObjectMaterializedEventArgs.cs
- TableProvider.cs
- ControlTemplate.cs
- CompareInfo.cs
- _AutoWebProxyScriptWrapper.cs
- InstanceKeyView.cs
- WebPartVerbCollection.cs
- SslSecurityTokenParameters.cs
- X509Certificate.cs
- PeerInputChannel.cs
- ProxyAttribute.cs
- SafeSystemMetrics.cs
- OperationParameterInfo.cs
- ReferentialConstraint.cs
- XpsS0ValidatingLoader.cs
- ProjectionCamera.cs
- PolicyUnit.cs
- ReaderWriterLock.cs
- CustomPopupPlacement.cs
- OleDbConnection.cs
- PixelFormat.cs
- ProxyWebPartManager.cs
- LabelAutomationPeer.cs
- Panel.cs
- PageSetupDialog.cs
- MemoryMappedViewAccessor.cs
- FlowDocumentReaderAutomationPeer.cs
- DetailsViewCommandEventArgs.cs
- XmlDocumentViewSchema.cs
- HierarchicalDataSourceIDConverter.cs
- TimerElapsedEvenArgs.cs