bool ShouldCreateItem(ShellItem folder) { FilterItemEventArgs e = new FilterItemEventArgs(folder); ShellItem myComputer = new ShellItem(Environment.SpecialFolder.MyComputer); e.Include = false; if (ShellItem.Desktop.IsImmediateParentOf(folder) || m_Computer.IsImmediateParentOf(folder)) { e.Include = folder.IsFileSystemAncestor; } else if ((folder == m_SelectedFolder) || folder.IsParentOf(m_SelectedFolder)) { e.Include = true; } if (FilterItem != null) { FilterItem(this, e); } return(e.Include); }
void m_ShellView_FilterItem(object sender, FilterItemEventArgs e) { // Include items that are present in the filesystem, and are a // folder, or match the current regex. if (e.Include) { e.Include = (e.Item.IsFileSystem || e.Item.IsFileSystemAncestor) && (e.Item.IsFolder || m_Regex.IsMatch(e.Item.FileSystemPath)); } }
bool IncludeItem(ShellItem item) { if (FilterItem != null) { FilterItemEventArgs e = new FilterItemEventArgs(item); FilterItem(this, e); return(e.Include); } else { return(true); } }
internal bool IncludeItem(IntPtr pidl) { if (FilterItem != null) { FilterItemEventArgs e = new FilterItemEventArgs( new ShellItem(m_CurrentFolder, pidl)); FilterItem(this, e); return(e.Include); } else { return(true); } }