BExplorer.Shell.ShellView.SelectItemByIndex C# (CSharp) Méthode

SelectItemByIndex() public méthode

Set this to focus then select an item by its index
public SelectItemByIndex ( Int32 index, Boolean ensureVisability = false, Boolean deselectOthers = false ) : void
index Int32 Index of item
ensureVisability Boolean Ensure that the item is visible?
deselectOthers Boolean Deselect all other items?
Résultat void
    public void SelectItemByIndex(Int32 index, Boolean ensureVisability = false, Boolean deselectOthers = false) {
      this.Focus();
      if (deselectOthers) {
        this.BeginInvoke((Action)(() => {
          this._IIListView.SetItemState(-1, LVIF.LVIF_STATE, LVIS.LVIS_SELECTED, 0);
        }));
      }

      var lvii = this.ToLvItemIndex(index);
      var lvi = new LVITEM() { mask = LVIF.LVIF_STATE, stateMask = LVIS.LVIS_SELECTED, state = LVIS.LVIS_SELECTED };
      User32.SendMessage(this.LVHandle, MSG.LVM_SETITEMINDEXSTATE, ref lvii, ref lvi);

      if (ensureVisability) {
        this.BeginInvoke((Action)(() => this._IIListView.EnsureItemVisible(lvii, true)));
      }
    }
ShellView