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
- SafeFileMapViewHandle.cs
- CheckBoxStandardAdapter.cs
- WsatServiceCertificate.cs
- TextEditorLists.cs
- ValidatorCollection.cs
- UrlMappingCollection.cs
- DataControlFieldHeaderCell.cs
- ExtensibleSyndicationObject.cs
- COAUTHINFO.cs
- Pen.cs
- ServerValidateEventArgs.cs
- StrongNameMembershipCondition.cs
- COM2AboutBoxPropertyDescriptor.cs
- PropertyCondition.cs
- XmlSchemaComplexContent.cs
- WorkflowApplicationAbortedEventArgs.cs
- ComponentDispatcher.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- ListViewGroupConverter.cs
- NotCondition.cs
- SelectedDatesCollection.cs
- StateWorkerRequest.cs
- X509Extension.cs
- VerticalAlignConverter.cs
- SettingsPropertyValue.cs
- CmsInterop.cs
- MouseGesture.cs
- DbConnectionHelper.cs
- OneWayElement.cs
- shaperfactory.cs
- DelayDesigner.cs
- coordinatorscratchpad.cs
- ColumnWidthChangingEvent.cs
- CryptoConfig.cs
- ResolveNameEventArgs.cs
- WebServiceHandler.cs
- CatalogPartChrome.cs
- InputReport.cs
- ColorInterpolationModeValidation.cs
- StringExpressionSet.cs
- util.cs
- SqlErrorCollection.cs
- OuterGlowBitmapEffect.cs
- WindowsRebar.cs
- XmlReturnWriter.cs
- ObjectSet.cs
- Image.cs
- PreviewKeyDownEventArgs.cs
- SystemColorTracker.cs
- DbXmlEnabledProviderManifest.cs
- Size.cs
- TextBoxBase.cs
- DifferencingCollection.cs
- DrawingState.cs
- ToolStripDropDownButton.cs
- SplitterCancelEvent.cs
- MetadataCollection.cs
- LicFileLicenseProvider.cs
- AddInSegmentDirectoryNotFoundException.cs
- x509store.cs
- LinkedResourceCollection.cs
- SqlConnection.cs
- WhitespaceRuleReader.cs
- XmlAggregates.cs
- XmlAttribute.cs
- NativeObjectSecurity.cs
- LinkUtilities.cs
- RenderDataDrawingContext.cs
- ControlEvent.cs
- XsltOutput.cs
- SAPIEngineTypes.cs
- QueryOpeningEnumerator.cs
- Itemizer.cs
- FormsAuthenticationUser.cs
- RTTypeWrapper.cs
- SettingsContext.cs
- BamlTreeMap.cs
- Delegate.cs
- FileUpload.cs
- XmlEncodedRawTextWriter.cs
- WebConfigurationFileMap.cs
- DecoderNLS.cs
- LocatorBase.cs
- Random.cs
- XPathItem.cs
- TTSEvent.cs
- GeometryGroup.cs
- ParenExpr.cs
- DesignerActionItemCollection.cs
- ColumnHeader.cs
- BuildDependencySet.cs
- QueryRewriter.cs
- TextRunCacheImp.cs
- DataGridViewColumnTypeEditor.cs
- Point3DAnimationUsingKeyFrames.cs
- ScopedKnownTypes.cs
- ProcessModule.cs
- TextEditorSelection.cs
- ApplicationSettingsBase.cs
- XPathAxisIterator.cs