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
- RSACryptoServiceProvider.cs
- WebConfigurationHostFileChange.cs
- WindowCollection.cs
- ParentQuery.cs
- SupportingTokenProviderSpecification.cs
- DataBoundControl.cs
- OdbcInfoMessageEvent.cs
- ExpressionBuilder.cs
- DataViewManagerListItemTypeDescriptor.cs
- namescope.cs
- ContextMenuService.cs
- EmbeddedObject.cs
- WebPartVerbCollection.cs
- AddInProcess.cs
- ViewCellRelation.cs
- TextTreeText.cs
- LinkedResourceCollection.cs
- RNGCryptoServiceProvider.cs
- UserPreferenceChangingEventArgs.cs
- sqlser.cs
- InnerItemCollectionView.cs
- DataSourceHelper.cs
- EmptyReadOnlyDictionaryInternal.cs
- AutoResizedEvent.cs
- EventMappingSettingsCollection.cs
- BoolExpr.cs
- DecoderBestFitFallback.cs
- LogRecordSequence.cs
- TemplateBuilder.cs
- MasterPageCodeDomTreeGenerator.cs
- RegisteredScript.cs
- XsltContext.cs
- CompressStream.cs
- CmsInterop.cs
- ProjectionPathSegment.cs
- PassportAuthenticationEventArgs.cs
- SQLCharsStorage.cs
- AuthenticatedStream.cs
- BrowserCapabilitiesCompiler.cs
- XamlFrame.cs
- ProfileService.cs
- RtfToken.cs
- ToolStripProgressBar.cs
- HtmlToClrEventProxy.cs
- LightweightCodeGenerator.cs
- ValueQuery.cs
- DataTableTypeConverter.cs
- AnimationClockResource.cs
- TextTreeTextBlock.cs
- PictureBoxDesigner.cs
- CounterCreationData.cs
- ResourceAssociationSet.cs
- SmtpCommands.cs
- ArrayTypeMismatchException.cs
- PointLight.cs
- SiblingIterators.cs
- SiteMembershipCondition.cs
- DynamicActivityTypeDescriptor.cs
- DataControlButton.cs
- PrivateFontCollection.cs
- SystemNetworkInterface.cs
- ValidatorUtils.cs
- SmiEventStream.cs
- ProfilePropertyMetadata.cs
- PreviewControlDesigner.cs
- CancellationTokenSource.cs
- documentation.cs
- WebPartZoneCollection.cs
- ConfigXmlText.cs
- EntityDataSourceStatementEditor.cs
- FormsAuthenticationUserCollection.cs
- DefaultHttpHandler.cs
- XmlUtf8RawTextWriter.cs
- ExpandCollapsePattern.cs
- SizeConverter.cs
- WindowsListBox.cs
- GroupQuery.cs
- BinaryQueryOperator.cs
- DateTimeConverter.cs
- MatrixUtil.cs
- SafeLibraryHandle.cs
- Win32Exception.cs
- RowUpdatingEventArgs.cs
- DbDataRecord.cs
- COSERVERINFO.cs
- precedingquery.cs
- EditBehavior.cs
- Int16Storage.cs
- WebPartDisplayMode.cs
- ListMarkerLine.cs
- Task.cs
- XamlToRtfParser.cs
- EdmItemError.cs
- PropertyPath.cs
- ApplyTemplatesAction.cs
- WindowsImpersonationContext.cs
- DataGridViewCellStyle.cs
- BaseDataList.cs
- WebPartMinimizeVerb.cs
- WsatProxy.cs