Click or drag to resize

ShellControlConnectorFolderChanging Event

Occurs, when navigating a folder. You can intercept navigation by setting the Cancel parameter in the event arguments.

Namespace:  Jam.Shell
Assembly:  ShellBrowser (in ShellBrowser.dll) Version: 7.1
Syntax
public event EventHandler<FolderChangingEventArgs> FolderChanging

Value

Type: SystemEventHandlerFolderChangingEventArgs
Examples
The following example demonstrates how to restrict access to a specific folder and its subfolders using the FolderChanging event.
C#
private ItemIdList m_RootItemIdList; //stores the ItemIdList of the allowed folder 
private void ShellControlConnector1_FolderChanging(object sender, FolderChangingEventArgs e)
{
    if (ItemIdList.IsNullOrInvalid(m_RootItemIdList))
        return;

    //We also want to allow the view, where the search result is presented and also subfolders from the search result.
    if (e.FolderIdList.IsSearchFolder || e.FolderIdList.IsInSearchFolder)
        return;
    //Else, only children of the stored root are allowed (and the root itself).
    e.Cancel = !(m_RootItemIdList.IsParentOf(e.FolderIdList));
}
See Also