예제 #1
0
        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);
        }
예제 #2
0
 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));
     }
 }
예제 #3
0
 bool IncludeItem(ShellItem item)
 {
     if (FilterItem != null)
     {
         FilterItemEventArgs e = new FilterItemEventArgs(item);
         FilterItem(this, e);
         return(e.Include);
     }
     else
     {
         return(true);
     }
 }
예제 #4
0
 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);
     }
 }