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
- PageParser.cs
- HMACSHA1.cs
- TableLayoutSettings.cs
- AsnEncodedData.cs
- SqlCommandBuilder.cs
- LicenseException.cs
- FixedSOMPage.cs
- WebPartTransformerAttribute.cs
- VisualStateManager.cs
- DbBuffer.cs
- SynchronousChannelMergeEnumerator.cs
- RootDesignerSerializerAttribute.cs
- CombinedTcpChannel.cs
- XmlEntity.cs
- ResourceReferenceKeyNotFoundException.cs
- AttributeSetAction.cs
- SqlDataSourceView.cs
- TcpClientSocketManager.cs
- GridViewColumnCollection.cs
- ToolStripSeparator.cs
- TabItemAutomationPeer.cs
- DefinitionUpdate.cs
- While.cs
- IPAddress.cs
- DataServiceQueryException.cs
- BitmapCache.cs
- WhitespaceRuleLookup.cs
- ExceptionUtil.cs
- Command.cs
- CodeTypeReference.cs
- AssertHelper.cs
- DataExpression.cs
- ObjRef.cs
- Boolean.cs
- CodeAccessSecurityEngine.cs
- HttpResponseInternalBase.cs
- UpdateTracker.cs
- Visitors.cs
- GeometryCombineModeValidation.cs
- ActivitySurrogate.cs
- Int16.cs
- ComponentCollection.cs
- XmlFormatExtensionPrefixAttribute.cs
- Utils.cs
- RoleService.cs
- ControlBuilderAttribute.cs
- DynamicMethod.cs
- XmlExtensionFunction.cs
- TimeSpanOrInfiniteValidator.cs
- PartialCachingAttribute.cs
- ExpressionTextBox.xaml.cs
- PackageProperties.cs
- CalendarDay.cs
- DBDataPermissionAttribute.cs
- HeaderedItemsControl.cs
- XmlNavigatorStack.cs
- DefaultProxySection.cs
- COM2ExtendedUITypeEditor.cs
- ActivityValidator.cs
- IPEndPoint.cs
- VerbConverter.cs
- CreationContext.cs
- TimeStampChecker.cs
- ToolboxItemCollection.cs
- CustomErrorsSection.cs
- MenuItemAutomationPeer.cs
- StyleTypedPropertyAttribute.cs
- FormsAuthenticationUser.cs
- SortDescriptionCollection.cs
- PointAnimationUsingPath.cs
- VScrollProperties.cs
- FamilyCollection.cs
- CheckBoxList.cs
- DataKeyArray.cs
- DataGridViewRowConverter.cs
- PasswordRecoveryDesigner.cs
- SQLDateTime.cs
- BaseTemplatedMobileComponentEditor.cs
- DesignerActionList.cs
- DataReaderContainer.cs
- MetadataArtifactLoaderResource.cs
- IsolationInterop.cs
- WorkflowItemsPresenter.cs
- StrokeNodeOperations.cs
- ViewManager.cs
- AdjustableArrowCap.cs
- ListViewInsertEventArgs.cs
- SystemInformation.cs
- TriggerActionCollection.cs
- WindowsTokenRoleProvider.cs
- AlphabeticalEnumConverter.cs
- ChannelSettingsElement.cs
- ViewStateException.cs
- ExpressionParser.cs
- SettingsBindableAttribute.cs
- EventMap.cs
- CodeValidator.cs
- ByteAnimation.cs
- WebScriptMetadataMessage.cs
- XmlDataSourceNodeDescriptor.cs