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
- PageParser.cs
- GridItemCollection.cs
- TextServicesPropertyRanges.cs
- SafeCryptoHandles.cs
- BufferedStream.cs
- OdbcConnectionOpen.cs
- ObjRef.cs
- AuthenticatedStream.cs
- TabletDeviceInfo.cs
- SocketConnection.cs
- XmlNodeChangedEventArgs.cs
- DesignerSerializationVisibilityAttribute.cs
- TreeNodeClickEventArgs.cs
- WindowsSpinner.cs
- ItemChangedEventArgs.cs
- selecteditemcollection.cs
- XmlSchemaAttributeGroup.cs
- AuthenticationManager.cs
- CustomAttributeFormatException.cs
- WhileDesigner.cs
- ConnectionProviderAttribute.cs
- ContentPosition.cs
- CustomValidator.cs
- SoapHttpTransportImporter.cs
- ExtensionWindowResizeGrip.cs
- Rotation3D.cs
- XPathParser.cs
- Evaluator.cs
- BatchStream.cs
- _DisconnectOverlappedAsyncResult.cs
- SourceFileInfo.cs
- RectangleHotSpot.cs
- StrongNameUtility.cs
- ToolStripItemGlyph.cs
- SchemaCreator.cs
- Splitter.cs
- OutputCacheSettings.cs
- BuildProvider.cs
- XmlUtf8RawTextWriter.cs
- StylusButtonEventArgs.cs
- TextRangeAdaptor.cs
- FormViewPageEventArgs.cs
- Thumb.cs
- _NTAuthentication.cs
- PointLightBase.cs
- MemoryMappedFile.cs
- basevalidator.cs
- StringConcat.cs
- TypeConverterHelper.cs
- XmlEventCache.cs
- ReachDocumentSequenceSerializerAsync.cs
- EndEvent.cs
- GenericPrincipal.cs
- MergeFailedEvent.cs
- altserialization.cs
- SettingsPropertyCollection.cs
- EndpointAddressElementBase.cs
- ResourceKey.cs
- DataGridViewLinkColumn.cs
- PropertyBuilder.cs
- DbInsertCommandTree.cs
- Char.cs
- CorrelationService.cs
- WsatServiceCertificate.cs
- Soap.cs
- ListenerAdaptersInstallComponent.cs
- IsolatedStoragePermission.cs
- EventProviderWriter.cs
- EFDataModelProvider.cs
- BaseCodePageEncoding.cs
- KeyProperty.cs
- UnsafeNativeMethodsPenimc.cs
- DispatcherFrame.cs
- DataGridViewCellStyleBuilderDialog.cs
- ListItemConverter.cs
- BamlCollectionHolder.cs
- AnimationException.cs
- ClientTargetSection.cs
- PatternMatcher.cs
- DocumentScope.cs
- LayoutEvent.cs
- WebBodyFormatMessageProperty.cs
- XmlWrappingReader.cs
- RegionData.cs
- Polygon.cs
- WebSysDescriptionAttribute.cs
- ArraySubsetEnumerator.cs
- Overlapped.cs
- DiagnosticTraceSource.cs
- SizeIndependentAnimationStorage.cs
- Constraint.cs
- DragCompletedEventArgs.cs
- XmlCDATASection.cs
- _NestedSingleAsyncResult.cs
- ImpersonateTokenRef.cs
- TagPrefixAttribute.cs
- ActivationServices.cs
- SynthesizerStateChangedEventArgs.cs
- HitTestParameters.cs
- HostingEnvironment.cs