Exemple #1
0
        /// <summary>
        /// Returns the current view mode of the browser
        /// </summary>
        /// <returns></returns>
        internal FolderViewMode GetCurrentViewMode()
        {
            IFolderView2 ifv2     = GetFolderView2();
            uint         viewMode = 0;

            if (ifv2 != null)
            {
                try {
                    HResult hr = ifv2.GetCurrentViewMode(out viewMode);
                    if (hr != HResult.Ok)
                    {
                        throw new ShellException(hr);
                    }
                } finally {
                    Marshal.ReleaseComObject(ifv2);
                    ifv2 = null;
                }
            }
            return((FolderViewMode)viewMode);
        }
        /// <summary>
        /// Returns the current view mode of the browser
        /// </summary>
        /// <returns></returns>
        internal FOLDERVIEWMODE GetCurrentViewMode()
        {
            IFolderView2 ifv2     = GetFolderView2();
            uint         viewMode = 0;

            if (ifv2 != null)
            {
                try
                {
                    HRESULT hr = ifv2.GetCurrentViewMode(out viewMode);
                    if (hr != HRESULT.S_OK)
                    {
                        throw Marshal.GetExceptionForHR((int)hr);
                    }
                }
                finally
                {
                    Marshal.ReleaseComObject(ifv2);
                    ifv2 = null;
                }
            }
            return((FOLDERVIEWMODE)viewMode);
        }