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
- TextParaClient.cs
- FormViewDeletedEventArgs.cs
- BindableAttribute.cs
- RightsManagementUser.cs
- XmlHierarchicalDataSourceView.cs
- localization.cs
- XPathBinder.cs
- PrtCap_Public_Simple.cs
- DetailsViewUpdatedEventArgs.cs
- AddInContractAttribute.cs
- XPathSelfQuery.cs
- ImagingCache.cs
- BamlRecords.cs
- TextCharacters.cs
- RegisteredDisposeScript.cs
- FormClosedEvent.cs
- SessionPageStateSection.cs
- DocumentViewerBase.cs
- BuildManager.cs
- HGlobalSafeHandle.cs
- ValidationError.cs
- EnumValAlphaComparer.cs
- GlyphCache.cs
- SortQuery.cs
- DirtyTextRange.cs
- EntityDataSourceView.cs
- SelectionChangedEventArgs.cs
- ConfigurationElement.cs
- UriSectionData.cs
- FunctionQuery.cs
- FullTextLine.cs
- Polyline.cs
- HttpHandlerActionCollection.cs
- TraceProvider.cs
- StdValidatorsAndConverters.cs
- ListBindingConverter.cs
- CodeSnippetCompileUnit.cs
- CodeGen.cs
- DataGridViewColumn.cs
- ServiceHttpModule.cs
- WebBrowserBase.cs
- SqlDataSourceConfigureSelectPanel.cs
- FileNameEditor.cs
- PolicyManager.cs
- UnsafeNativeMethods.cs
- KnownBoxes.cs
- PointAnimationClockResource.cs
- MemoryFailPoint.cs
- CssTextWriter.cs
- LookupBindingPropertiesAttribute.cs
- DynamicMetaObjectBinder.cs
- DataGridCaption.cs
- StateBag.cs
- LambdaCompiler.ControlFlow.cs
- AssemblyCollection.cs
- LinkButton.cs
- PeerContact.cs
- EntityContainerRelationshipSetEnd.cs
- SQLInt16.cs
- KeyMatchBuilder.cs
- XmlILIndex.cs
- DistributedTransactionPermission.cs
- AssemblyNameEqualityComparer.cs
- TcpHostedTransportConfiguration.cs
- InputMethodStateChangeEventArgs.cs
- XmlTextEncoder.cs
- SelectorItemAutomationPeer.cs
- Repeater.cs
- FixedSOMSemanticBox.cs
- Expression.cs
- ListenerConfig.cs
- ResourceAttributes.cs
- ThrowHelper.cs
- Screen.cs
- UserNamePasswordServiceCredential.cs
- SocketException.cs
- ConnectAlgorithms.cs
- WebPartCloseVerb.cs
- LinkedList.cs
- ListViewTableRow.cs
- ListCommandEventArgs.cs
- DesignerVerbCollection.cs
- BindingBase.cs
- ExtensionWindow.cs
- CollectionViewGroupInternal.cs
- SapiRecoInterop.cs
- PropertyEmitterBase.cs
- ExtensionSimplifierMarkupObject.cs
- ReadOnlyCollection.cs
- DynamicVirtualDiscoSearcher.cs
- GetLedgerRequest.cs
- ToolBarButtonClickEvent.cs
- TextElementEditingBehaviorAttribute.cs
- ProfileGroupSettings.cs
- FunctionParameter.cs
- SchemaCollectionCompiler.cs
- NameValueConfigurationCollection.cs
- DbMetaDataColumnNames.cs
- _NestedMultipleAsyncResult.cs
- ImageList.cs