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
- ScopelessEnumAttribute.cs
- embossbitmapeffect.cs
- BindingCollection.cs
- IndexerHelper.cs
- ParameterCollection.cs
- SkewTransform.cs
- ToolTip.cs
- MDIClient.cs
- AsymmetricKeyExchangeFormatter.cs
- LinkConverter.cs
- ListViewTableRow.cs
- RuntimeCompatibilityAttribute.cs
- ServiceDebugElement.cs
- ResourceSet.cs
- ClassHandlersStore.cs
- ExtentJoinTreeNode.cs
- TemplateNameScope.cs
- ProviderBase.cs
- IncrementalReadDecoders.cs
- CounterCreationDataCollection.cs
- NativeWindow.cs
- Stacktrace.cs
- RemoteWebConfigurationHost.cs
- SessionPageStatePersister.cs
- TextEditorThreadLocalStore.cs
- Operators.cs
- ConvertTextFrag.cs
- Span.cs
- ChtmlTextWriter.cs
- ByteAnimationBase.cs
- ServiceChannelManager.cs
- ImageEditor.cs
- EmbeddedMailObject.cs
- ReferenceSchema.cs
- ControlBuilder.cs
- BookmarkScope.cs
- _HeaderInfoTable.cs
- DateTimeStorage.cs
- DataControlCommands.cs
- PermissionToken.cs
- ErrorWrapper.cs
- HandlerBase.cs
- GridViewItemAutomationPeer.cs
- HebrewCalendar.cs
- Atom10FormatterFactory.cs
- ResourceIDHelper.cs
- NullableLongSumAggregationOperator.cs
- TargetException.cs
- DataTrigger.cs
- EventMappingSettingsCollection.cs
- BitSet.cs
- HtmlSelect.cs
- QilGeneratorEnv.cs
- RequiredAttributeAttribute.cs
- XmlCharacterData.cs
- WebBrowserHelper.cs
- ShapingEngine.cs
- GZipStream.cs
- EpmCustomContentWriterNodeData.cs
- ReceiveDesigner.xaml.cs
- DataTemplate.cs
- WebPartConnectionsCancelVerb.cs
- XmlSchemaException.cs
- AdapterDictionary.cs
- IApplicationTrustManager.cs
- ToolBar.cs
- Menu.cs
- DataListItem.cs
- SafeProcessHandle.cs
- ListViewDeletedEventArgs.cs
- DataTableReader.cs
- DocumentApplicationJournalEntry.cs
- MasterPageParser.cs
- VisualStyleRenderer.cs
- Stylus.cs
- dbdatarecord.cs
- ScriptServiceAttribute.cs
- CustomErrorsSectionWrapper.cs
- FreezableDefaultValueFactory.cs
- ImageAutomationPeer.cs
- CardSpacePolicyElement.cs
- TargetException.cs
- DataGridViewRowCancelEventArgs.cs
- FileDialog_Vista.cs
- ExpressionTextBox.xaml.cs
- TypeSystemProvider.cs
- SearchForVirtualItemEventArgs.cs
- WsdlContractConversionContext.cs
- CalendarDay.cs
- MachineKeyConverter.cs
- BeginStoryboard.cs
- Wizard.cs
- MimeAnyImporter.cs
- SettingsProviderCollection.cs
- COAUTHIDENTITY.cs
- AggregateException.cs
- EncodingInfo.cs
- CannotUnloadAppDomainException.cs
- BlockingCollection.cs
- ToolStrip.cs