src/Misc/EFTools/DesignXmlCore/Common/RdtManager.cs
/// <summary>
///     Returns the docdata for this cookie on the rdt
/// </summary>
Returns the docdata for this cookie on the rdt
Returns the docdata for this cookie on the rdt
[SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate")]
        public static bool TryGetDocDataFromCookie(uint cookie, out object docData)
        {
            docData = null;
            var rdt = Instance.GetRunningDocumentTable();
            Debug.Assert(rdt != null);
            if (rdt != null)
            {
                VsShell.IVsHierarchy hierarchy;
                uint rdtFlags;
                uint readLocks;
                uint editLocks;
                string itemName;
                uint itemId;
                IntPtr unknownDocData;
                var hr = rdt.GetDocumentInfo(
                    cookie,
                    out rdtFlags,
                    out readLocks,
                    out editLocks,
                    out itemName,
                    out hierarchy,
                    out itemId,
                    out unknownDocData);
                if (NativeMethods.Succeeded(hr))
                {
                    docData = Marshal.GetObjectForIUnknown(unknownDocData);
                    Marshal.Release(unknownDocData);
                    return true;
                }
            }
            return false;
        }
[ SuppressMessage ( " " , " " ) ] public static bool TryGetDocDataFromCookie ( uint cookie , out object docData ) { docData = null ; var rdt = Instance . GetRunningDocumentTable ( ) ; Debug . Assert ( rdt != null ) ; if ( rdt != null ) { VsShell . IVsHierarchy hierarchy ; uint rdtFlags ; uint readLocks ; uint editLocks ; string itemName ; uint itemId ; IntPtr unknownDocData ; var hr = rdt . GetDocumentInfo ( cookie , out rdtFlags , out readLocks , out editLocks , out itemName , out hierarchy , out itemId , out unknownDocData ) ; if ( NativeMethods . Succeeded ( hr ) ) { docData = Marshal . GetObjectForIUnknown ( unknownDocData ) ; Marshal . Release ( unknownDocData ) ; return true ; } } return false ; }
Returns the docdata for this cookie on the rdt
Returns the docdata for this cookie on the rdt
cookie
uint
object
out