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
- ParallelTimeline.cs
- ReflectionUtil.cs
- InvalidBodyAccessException.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- UserNameSecurityTokenAuthenticator.cs
- ChannelServices.cs
- OleDbWrapper.cs
- UnsafeNativeMethods.cs
- VariableElement.cs
- DataRelationPropertyDescriptor.cs
- HideDisabledControlAdapter.cs
- ipaddressinformationcollection.cs
- GreenMethods.cs
- StaticExtensionConverter.cs
- BindingListCollectionView.cs
- DirectoryObjectSecurity.cs
- PropagatorResult.cs
- GcHandle.cs
- CellIdBoolean.cs
- COM2ExtendedBrowsingHandler.cs
- RSAPKCS1SignatureDeformatter.cs
- TaiwanLunisolarCalendar.cs
- WebBrowserNavigatedEventHandler.cs
- CallSiteBinder.cs
- ShaderEffect.cs
- Compress.cs
- FixedSOMContainer.cs
- XsltFunctions.cs
- FlowDocumentPage.cs
- CodeAssignStatement.cs
- COM2ExtendedBrowsingHandler.cs
- Span.cs
- DataPagerCommandEventArgs.cs
- LoadRetryStrategyFactory.cs
- ObjectDisposedException.cs
- WebPartMinimizeVerb.cs
- FtpWebRequest.cs
- DynamicObjectAccessor.cs
- HtmlInputSubmit.cs
- SchemaElementDecl.cs
- RtType.cs
- DtrList.cs
- SiteMapProvider.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- XmlILCommand.cs
- UserNamePasswordClientCredential.cs
- ConnectorRouter.cs
- DefaultValidator.cs
- RowsCopiedEventArgs.cs
- SqlDelegatedTransaction.cs
- SuppressIldasmAttribute.cs
- TextureBrush.cs
- AppDomainAttributes.cs
- BamlRecordHelper.cs
- UIElementParaClient.cs
- FeatureSupport.cs
- ApplicationManager.cs
- ImageConverter.cs
- CacheSection.cs
- Animatable.cs
- BaseDataBoundControl.cs
- PrinterUnitConvert.cs
- EdmFunction.cs
- CustomErrorsSectionWrapper.cs
- EntityDataSourceWrapper.cs
- ForEachDesigner.xaml.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- BamlRecordHelper.cs
- VectorConverter.cs
- QilXmlReader.cs
- SingleAnimationUsingKeyFrames.cs
- RoleServiceManager.cs
- SystemException.cs
- AdjustableArrowCap.cs
- RuntimeConfig.cs
- SqlBulkCopy.cs
- _NativeSSPI.cs
- TimeSpan.cs
- KeyedHashAlgorithm.cs
- COAUTHIDENTITY.cs
- ConstraintStruct.cs
- AVElementHelper.cs
- DetailsViewDeletedEventArgs.cs
- printdlgexmarshaler.cs
- BasicHttpMessageCredentialType.cs
- XmlArrayItemAttribute.cs
- NumericUpDownAccelerationCollection.cs
- CodeArrayCreateExpression.cs
- MsmqIntegrationChannelFactory.cs
- EncryptedData.cs
- MonthCalendar.cs
- ConvertersCollection.cs
- IISMapPath.cs
- _KerberosClient.cs
- Pkcs9Attribute.cs
- ServiceDescription.cs
- EntityDataSourceWrapperCollection.cs
- SelectedCellsCollection.cs
- SmiEventSink.cs
- documentsequencetextpointer.cs