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

InsertNewItem() public method

Inserts a new item into the control If and only If it is new. Returns the item's index OR -1 if already existing
public InsertNewItem ( IListItemEx obj ) : Int32
obj IListItemEx The item you want to insert
return Int32
    public Int32 InsertNewItem(IListItemEx obj) {
      if (!this._AddedItems.Contains(obj.PIDL) && !String.IsNullOrEmpty(obj.ParsingName) && obj.IsInCurrentFolder(this.CurrentFolder)) {
        this.Items.Add(obj);
        this._AddedItems.Add(obj.PIDL);
        var col = this.AllAvailableColumns.FirstOrDefault(w => w.Value.ID == this.LastSortedColumnId).Value;
        this.SetSortCollumn(true, col, this.LastSortOrder, false);
        if (this.IsGroupsEnabled) this.SetGroupOrder(false);
        var itemIndex = obj.ItemIndex;
        return itemIndex;
      }
      return -1;
    }
ShellView