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
- StreamMarshaler.cs
- ICspAsymmetricAlgorithm.cs
- util.cs
- PanelDesigner.cs
- BufferedReadStream.cs
- KnownIds.cs
- Geometry.cs
- ClientViaElement.cs
- DbConnectionInternal.cs
- SelectingProviderEventArgs.cs
- SchemaInfo.cs
- DataGridViewTextBoxEditingControl.cs
- HandlerMappingMemo.cs
- XmlSchemaValidationException.cs
- HttpClientProtocol.cs
- AliasGenerator.cs
- XslVisitor.cs
- DirectoryObjectSecurity.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- IHttpResponseInternal.cs
- Quaternion.cs
- GrammarBuilderWildcard.cs
- Track.cs
- TypedReference.cs
- DockingAttribute.cs
- DataGridViewLayoutData.cs
- MimePart.cs
- Configuration.cs
- DesignerSerializerAttribute.cs
- XmlSchemaObject.cs
- FontFamilyValueSerializer.cs
- FloaterParagraph.cs
- ApplicationCommands.cs
- SqlDataSourceDesigner.cs
- WindowsGraphics.cs
- DataBindingList.cs
- Parser.cs
- TimeSpanStorage.cs
- LineVisual.cs
- OracleParameterCollection.cs
- XmlAttributeProperties.cs
- SafeEventLogReadHandle.cs
- TextMetrics.cs
- DataGridBoolColumn.cs
- FrameworkElementFactoryMarkupObject.cs
- ReadOnlyTernaryTree.cs
- GridViewCellAutomationPeer.cs
- SocketSettings.cs
- ApplicationTrust.cs
- Tuple.cs
- AutoGeneratedFieldProperties.cs
- PointAnimationUsingKeyFrames.cs
- WebPartZoneCollection.cs
- RowParagraph.cs
- WebPartVerbsEventArgs.cs
- RelatedImageListAttribute.cs
- AssemblySettingAttributes.cs
- SafeHandle.cs
- DocumentViewerConstants.cs
- RepeatButtonAutomationPeer.cs
- BufferAllocator.cs
- ForEachDesigner.xaml.cs
- SoapObjectWriter.cs
- CollectionType.cs
- Action.cs
- SettingsPropertyNotFoundException.cs
- SynthesizerStateChangedEventArgs.cs
- String.cs
- CompositeDuplexElement.cs
- WpfXamlMember.cs
- Graphics.cs
- BufferAllocator.cs
- Sequence.cs
- QueryCreatedEventArgs.cs
- ExpressionWriter.cs
- UriSectionData.cs
- RetrieveVirtualItemEventArgs.cs
- DiscoveryDocument.cs
- TableColumn.cs
- LookupBindingPropertiesAttribute.cs
- KeyValuePairs.cs
- TransformPatternIdentifiers.cs
- DbFunctionCommandTree.cs
- DefaultBinder.cs
- TimersDescriptionAttribute.cs
- DisposableCollectionWrapper.cs
- HttpServerUtilityBase.cs
- TextAction.cs
- DescriptionAttribute.cs
- _DynamicWinsockMethods.cs
- ConfigXmlSignificantWhitespace.cs
- DetailsViewCommandEventArgs.cs
- DataServiceExpressionVisitor.cs
- ToolboxComponentsCreatingEventArgs.cs
- Cursor.cs
- PropertyChangedEventManager.cs
- InputLangChangeEvent.cs
- WpfSharedXamlSchemaContext.cs
- HttpFileCollection.cs
- InternalConfigRoot.cs