예제 #1
0
    private void miRestoreRBItems_Click(object sender, RoutedEventArgs e) {
      foreach (var item in _ShellListView.SelectedItems.ToArray()) {
        Folder Recycler = new Shell().NameSpace(10);
        for (int i = 0; i < Recycler.Items().Count; i++) {
          Shell32.FolderItem FI = Recycler.Items().Item(i);
          string FileName = Recycler.GetDetailsOf(FI, 0);
          if (Path.GetExtension(FileName) == "") FileName += Path.GetExtension(FI.Path);
          //Necessary for systems with hidden file extensions.
          string FilePath = Recycler.GetDetailsOf(FI, 1);
          if (item.FileSystemPath == Path.Combine(FilePath, FileName)) {
            DoVerb(FI, "ESTORE");
            break;
          }
        }
      }

      UpdateRecycleBinInfos();
    }