|
4 | 4 |
|
5 | 5 | namespace System.Runtime.InteropServices.ComTypes |
6 | 6 | { |
| 7 | + /// <devdoc> |
| 8 | + /// The IDataObject interface specifies methods that enable data transfer |
| 9 | + /// and notification of changes in data. Data transfer methods specify |
| 10 | + /// the format of the transferred data along with the medium through |
| 11 | + /// which the data is to be transferred. Optionally, the data can be |
| 12 | + /// rendered for a specific target device. In addition to methods for |
| 13 | + /// retrieving and storing data, the IDataObject interface specifies |
| 14 | + /// methods for enumerating available formats and managing connections |
| 15 | + /// to advisory sinks for handling change notifications. |
| 16 | + /// </devdoc> |
7 | 17 | [CLSCompliant(false)] |
8 | | - public interface IDataObject |
9 | | - { |
10 | | - int DAdvise(ref FORMATETC pFormatetc, ADVF advf, IAdviseSink adviseSink, out int connection); |
| 18 | + [ComImport()] |
| 19 | + [Guid("0000010E-0000-0000-C000-000000000046")] |
| 20 | + [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] |
| 21 | + public interface IDataObject { |
| 22 | + |
| 23 | + /// <devdoc> |
| 24 | + /// Called by a data consumer to obtain data from a source data object. |
| 25 | + /// The GetData method renders the data described in the specified FORMATETC |
| 26 | + /// structure and transfers it through the specified STGMEDIUM structure. |
| 27 | + /// The caller then assumes responsibility for releasing the STGMEDIUM structure. |
| 28 | + /// </devdoc> |
| 29 | + void GetData([In] ref FORMATETC format, out STGMEDIUM medium); |
| 30 | + |
| 31 | + /// <devdoc> |
| 32 | + /// Called by a data consumer to obtain data from a source data object. |
| 33 | + /// This method differs from the GetData method in that the caller must |
| 34 | + /// allocate and free the specified storage medium. |
| 35 | + /// </devdoc> |
| 36 | + void GetDataHere([In] ref FORMATETC format, ref STGMEDIUM medium); |
| 37 | + |
| 38 | + /// <devdoc> |
| 39 | + /// Determines whether the data object is capable of rendering the data |
| 40 | + /// described in the FORMATETC structure. Objects attempting a paste or |
| 41 | + /// drop operation can call this method before calling IDataObject::GetData |
| 42 | + /// to get an indication of whether the operation may be successful. |
| 43 | + /// </devdoc> |
| 44 | + [PreserveSig] |
| 45 | + int QueryGetData([In] ref FORMATETC format); |
| 46 | + |
| 47 | + /// <devdoc> |
| 48 | + /// Provides a standard FORMATETC structure that is logically equivalent to one that is more |
| 49 | + /// complex. You use this method to determine whether two different |
| 50 | + /// FORMATETC structures would return the same data, removing the need |
| 51 | + /// for duplicate rendering. |
| 52 | + /// </devdoc> |
| 53 | + [PreserveSig] |
| 54 | + int GetCanonicalFormatEtc([In] ref FORMATETC formatIn, out FORMATETC formatOut); |
| 55 | + |
| 56 | + /// <devdoc> |
| 57 | + /// Called by an object containing a data source to transfer data to |
| 58 | + /// the object that implements this method. |
| 59 | + /// </devdoc> |
| 60 | + void SetData([In] ref FORMATETC formatIn, [In] ref STGMEDIUM medium, [MarshalAs(UnmanagedType.Bool)] bool release); |
| 61 | + |
| 62 | + /// <devdoc> |
| 63 | + /// Creates an object for enumerating the FORMATETC structures for a |
| 64 | + /// data object. These structures are used in calls to IDataObject::GetData |
| 65 | + /// or IDataObject::SetData. |
| 66 | + /// </devdoc> |
| 67 | + IEnumFORMATETC EnumFormatEtc(DATADIR direction); |
| 68 | + |
| 69 | + /// <devdoc> |
| 70 | + /// Called by an object supporting an advise sink to create a connection between |
| 71 | + /// a data object and the advise sink. This enables the advise sink to be |
| 72 | + /// notified of changes in the data of the object. |
| 73 | + /// </devdoc> |
| 74 | + [PreserveSig] |
| 75 | + int DAdvise([In] ref FORMATETC pFormatetc, ADVF advf, IAdviseSink adviseSink, out int connection); |
| 76 | + |
| 77 | + /// <devdoc> |
| 78 | + /// Destroys a notification connection that had been previously set up. |
| 79 | + /// </devdoc> |
11 | 80 | void DUnadvise(int connection); |
| 81 | + |
| 82 | + /// <devdoc> |
| 83 | + /// Creates an object that can be used to enumerate the current advisory connections. |
| 84 | + /// </devdoc> |
| 85 | + [PreserveSig] |
12 | 86 | int EnumDAdvise(out IEnumSTATDATA enumAdvise); |
13 | | - IEnumFORMATETC EnumFormatEtc(DATADIR direction); |
14 | | - int GetCanonicalFormatEtc(ref FORMATETC formatIn, out FORMATETC formatOut); |
15 | | - void GetData(ref FORMATETC format, out STGMEDIUM medium); |
16 | | - void GetDataHere(ref FORMATETC format, ref STGMEDIUM medium); |
17 | | - int QueryGetData(ref FORMATETC format); |
18 | | - void SetData(ref FORMATETC formatIn, ref STGMEDIUM medium, bool release); |
19 | 87 | } |
20 | 88 | } |
0 commit comments