Esempio n. 1
0
        /// <summary>
        /// Sets folder logical view mode. The default settings are based on the FolderTypeID which is set
        /// by the SearchFolder::SetFolderTypeID method.
        /// </summary>
        /// <param name="mode">The logical view mode to set.</param>
        public void SetFolderLogicalViewMode(FolderLogicalViewMode mode)
        {
            HResult hr = NativeSearchFolderItemFactory.SetFolderLogicalViewMode(mode);

            if (!CoreErrorHelper.Succeeded(hr))
            {
                throw new ShellException(hr);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Sets the search folder icon size.
        /// The default settings are based on the FolderTypeID which is set by the
        /// SearchFolder::SetFolderTypeID method.
        /// </summary>
        public void SetIconSize(int value)
        {
            HResult hr = NativeSearchFolderItemFactory.SetIconSize(value);

            if (!CoreErrorHelper.Succeeded(hr))
            {
                throw new ShellException(hr);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Sets a search folder type ID, as specified.
        /// </summary>
        public void SetFolderTypeID(Guid value)
        {
            HResult hr = NativeSearchFolderItemFactory.SetFolderTypeID(value);

            if (!CoreErrorHelper.Succeeded(hr))
            {
                throw new ShellException(hr);
            }
        }
        /// <summary>
        /// Sets a group column, as specified. If no group column is specified, no grouping occurs.
        /// </summary>
        /// <remarks>This property may not work correctly with the ExplorerBrowser control.</remarks>
        public void SetGroupColumn(PropertyKey propertyKey)
        {
            HResult hr = NativeSearchFolderItemFactory.SetGroupColumn(ref propertyKey);

            if (!CoreErrorHelper.Succeeded(hr))
            {
                throw new ShellException(hr);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Sets the search folder display name.
        /// </summary>
        public void SetDisplayName(string displayName)
        {
            HResult hr = NativeSearchFolderItemFactory.SetDisplayName(displayName);

            if (!CoreErrorHelper.Succeeded(hr))
            {
                throw new ShellException(hr);
            }
        }
        /// <summary>
        /// Sets folder logical view mode. The default settings are based on the FolderTypeID which is set
        /// by the SearchFolder::SetFolderTypeID method.
        /// </summary>
        /// <param name="mode">The logical view mode to set.</param>
        public void SetFolderLogicalViewMode(FolderLogicalViewMode mode)
        {
            HRESULT hr = NativeSearchFolderItemFactory.SetFolderLogicalViewMode(mode);

            if (!CoreErrorHelper.Succeeded((int)hr))
            {
                Marshal.ThrowExceptionForHR((int)hr);
            }
        }
        /// <summary>
        /// Creates a list of sort column directions, as specified.
        /// </summary>
        /// <remarks>This property may not work correctly with the ExplorerBrowser control.</remarks>
        public void SortColumns(SortColumn[] value)
        {
            HResult hr = NativeSearchFolderItemFactory.SetSortColumns(value == null ? 0 : (uint)value.Length, value);

            if (!CoreErrorHelper.Succeeded(hr))
            {
                throw new ShellException(LocalizedMessages.ShellSearchFolderUnableToSetSortColumns, Marshal.GetExceptionForHR((int)hr));
            }
        }
Esempio n. 8
0
        /// <summary>
        /// Creates a new column list whose columns are all visible,
        /// given an array of PropertyKey structures. The default is based on FolderTypeID.
        /// </summary>
        /// <remarks>This property may not work correctly with the ExplorerBrowser control.</remarks>
        public void SetVisibleColumns(PROPERTYKEY[] value)
        {
            HResult hr = NativeSearchFolderItemFactory.SetVisibleColumns(value == null ? 0 : (uint)value.Length, value);

            if (hr != HResult.S_OK)
            {
                throw Marshal.GetExceptionForHR((int)hr);
            }
        }
Esempio n. 9
0
        /// <summary>
        /// Sets folder logical view mode. The default settings are based on the FolderTypeID which is set
        /// by the SearchFolder::SetFolderTypeID method.
        /// </summary>
        /// <param name="mode">The logical view mode to set.</param>
        public void SetFolderLogicalViewMode(FolderLogicalViewMode mode)
        {
            HResult hr = NativeSearchFolderItemFactory.SetFolderLogicalViewMode(mode);

            if (hr != HResult.S_OK)
            {
                throw new Exception(hr.ToString());
            }
        }
Esempio n. 10
0
        /// <summary>
        /// Sets a search folder type ID, as specified.
        /// </summary>
        public void SetFolderTypeID(Guid value)
        {
            HResult hr = NativeSearchFolderItemFactory.SetFolderTypeID(value);

            if (hr != HResult.S_OK)
            {
                throw new Exception(hr.ToString());
            }
        }
Esempio n. 11
0
        /// <summary>
        /// Sets the search folder icon size.
        /// The default settings are based on the FolderTypeID which is set by the
        /// SearchFolder::SetFolderTypeID method.
        /// </summary>
        public void SetIconSize(int value)
        {
            HResult hr = NativeSearchFolderItemFactory.SetIconSize(value);

            if (hr != HResult.S_OK)
            {
                throw new Exception(hr.ToString());
            }
        }
Esempio n. 12
0
        /// <summary>
        /// Sets the search folder display name.
        /// </summary>
        public void SetDisplayName(string displayName)
        {
            HResult hr = NativeSearchFolderItemFactory.SetDisplayName(displayName);

            if (hr != HResult.S_OK)
            {
                throw new Exception(hr.ToString());
            }
        }
Esempio n. 13
0
        /// <summary>
        /// Creates a list of stack keys, as specified. If this method is not called,
        /// by default the folder will not be stacked.
        /// </summary>
        /// <param name="propertyKeys">Array of property keys on which the folder is stacked.</param>
        public void SetStacks(params PROPERTYKEY[] propertyKeys)
        {
            if (propertyKeys?.Length > 0)
            {
                NativeSearchFolderItemFactory.SetStacks((uint)propertyKeys.Length, propertyKeys);
            }

            //if (propertyKeys != null && propertyKeys.Length > 0) {
            //	NativeSearchFolderItemFactory.SetStacks((uint)propertyKeys.Length, propertyKeys);
            //}
        }