BExplorer.Shell.DropExtensions.Advise C# (CSharp) Method

Advise() public static method

Sets up an advisory connection to the data object.
public static Advise ( this dataObject, IAdviseSink sink, string format, ADVF advf ) : int
dataObject this The data object on which to set the advisory connection.
sink IAdviseSink The advisory sink.
format string The format on which to callback on.
advf ADVF Advisory flags. Can be 0.
return int
        public static int Advise(this System.Runtime.InteropServices.ComTypes.IDataObject dataObject, IAdviseSink sink, string format, ADVF advf)
        {
            // Internally, we'll listen for any TYMED
            FORMATETC formatETC;
            FillFormatETC(format, TYMED_ANY, out formatETC);

            int connection;
            int hr = dataObject.DAdvise(ref formatETC, advf, sink, out connection);
            if (hr != 0) Marshal.ThrowExceptionForHR(hr);
            return connection;
        }