BExplorer.Shell.ShellView.RefreshItem C# (CSharp) Method

RefreshItem() public method

Refreshes a single item
public RefreshItem ( Int32 index, Boolean isForceRedraw = false ) : void
index Int32 The index of the item you want to refresh
isForceRedraw Boolean If True Resets everything in the Item to indicate that it needs to be refreshed/reloaded
return void
    public void RefreshItem(Int32 index, Boolean isForceRedraw = false) {
      if (isForceRedraw) {
        try {
          _ResetEvent.Set();
          var newItem = FileSystemListItem.ToFileSystemItem(this.LVHandle, this.Items[index].ParsingName.ToShellParsingName());
          newItem.GroupIndex = this.Items[index].GroupIndex;
          newItem.ItemIndex = index;
          this.Items[index] = newItem;
          this.Items[index].IsNeedRefreshing = true;
          this.Items[index].IsInvalid = true;
          //this.Items[index].OverlayIconIndex = -1;
          this.SmallImageList.EnqueueOverlay(index);
          this.Items[index].IsOnlyLowQuality = false;
          this.Items[index].IsIconLoaded = false;

        } catch (FileNotFoundException) {
          _ResetEvent.Set();
          //In case the event late and the file is not there anymore or changed catch the exception
          var newItem = FileSystemListItem.ToFileSystemItem(this.LVHandle, this.Items[index].PIDL);
          newItem.GroupIndex = this.Items[index].GroupIndex;
          newItem.ItemIndex = index;
          this.Items[index] = newItem;
          this.Items[index].IsNeedRefreshing = true;
          this.Items[index].IsInvalid = true;
          //this.Items[index].OverlayIconIndex = -1;
          this.SmallImageList.EnqueueOverlay(index);
          this.Items[index].IsOnlyLowQuality = false;
          this.Items[index].IsIconLoaded = false;
        } catch { }
      }

      this.Invoke(new MethodInvoker(() => {
        this._IIListView.UpdateItem(index);
        this._IIListView.RedrawItems(index, index);
      }));
    }
ShellView