Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- EncoderBestFitFallback.cs
- SmtpCommands.cs
- CharAnimationBase.cs
- hwndwrapper.cs
- panel.cs
- FormViewDeleteEventArgs.cs
- RequestCacheManager.cs
- PackageProperties.cs
- DataGridCaption.cs
- GroupBox.cs
- ZipIOCentralDirectoryFileHeader.cs
- MarshalDirectiveException.cs
- ObjectHandle.cs
- AutomationProperties.cs
- XmlSchemaSimpleContentRestriction.cs
- XmlAtomErrorReader.cs
- ObjectStorage.cs
- EnumDataContract.cs
- EntityException.cs
- TranslateTransform.cs
- StylusTip.cs
- TransformationRules.cs
- ValueTypeFixupInfo.cs
- DocumentSequenceHighlightLayer.cs
- ReferencedAssembly.cs
- MaskInputRejectedEventArgs.cs
- DataObjectAttribute.cs
- BlurBitmapEffect.cs
- _StreamFramer.cs
- LambdaCompiler.Unary.cs
- JsonWriterDelegator.cs
- NavigationService.cs
- VsPropertyGrid.cs
- ResourcesGenerator.cs
- FileChangesMonitor.cs
- RegisteredExpandoAttribute.cs
- RemotingAttributes.cs
- XPathNavigatorReader.cs
- AssemblyAssociatedContentFileAttribute.cs
- StaticTextPointer.cs
- SchemeSettingElement.cs
- AuthenticationModulesSection.cs
- XamlFigureLengthSerializer.cs
- MetaChildrenColumn.cs
- MemberInfoSerializationHolder.cs
- CompilerParameters.cs
- TextSimpleMarkerProperties.cs
- SQLStringStorage.cs
- FlowDocumentPage.cs
- WmlImageAdapter.cs
- XmlSigningNodeWriter.cs
- NonSerializedAttribute.cs
- RequestNavigateEventArgs.cs
- _AcceptOverlappedAsyncResult.cs
- XmlChildNodes.cs
- ImageConverter.cs
- DbModificationClause.cs
- FixedHighlight.cs
- ToolStripMenuItem.cs
- GridViewRowPresenter.cs
- ApplicationSettingsBase.cs
- CodeTypeParameter.cs
- NativeMethods.cs
- DataControlFieldCell.cs
- DataTemplateSelector.cs
- DeclarativeCatalogPart.cs
- XmlRawWriter.cs
- Pts.cs
- MeasureData.cs
- UpdateManifestForBrowserApplication.cs
- SQLByteStorage.cs
- OrderByLifter.cs
- StrongNameUtility.cs
- RichTextBoxConstants.cs
- PerformanceCounterManager.cs
- OAVariantLib.cs
- PointAnimation.cs
- XamlDesignerSerializationManager.cs
- FormsAuthenticationUserCollection.cs
- XsdDuration.cs
- CodeThrowExceptionStatement.cs
- TreeViewCancelEvent.cs
- PropertyOverridesTypeEditor.cs
- XPathEmptyIterator.cs
- categoryentry.cs
- XComponentModel.cs
- ArrayWithOffset.cs
- TextEditorParagraphs.cs
- MultipleViewPattern.cs
- WebPartVerb.cs
- X500Name.cs
- CursorInteropHelper.cs
- RelativeSource.cs
- ProcessInfo.cs
- FilterEventArgs.cs
- PropertyFilterAttribute.cs
- SubMenuStyleCollection.cs
- _OverlappedAsyncResult.cs
- UshortList2.cs
- InputLangChangeRequestEvent.cs