Наследование: System.Windows.Forms.ListViewItem
Пример #1
0
        private void ltvTransactions_KeyDown(object sender, KeyEventArgs e)
        {
            if (this.ltvTransactions.SelectedIndices.Count <= 0)
            {
                return;
            }
            TransactionViewItem tvi = this.TransactionsViewItems[this.ltvTransactions.SelectedIndices[0]] as TransactionViewItem;

            if (tvi == null)
            {
                return;
            }
            if (tvi.ImageIndex == 0 && (e.KeyData == Keys.Return || e.KeyData == Keys.Right))
            {
                this.Expand(tvi);
            }
            else
            {
                if (tvi.ImageIndex != 1 || e.KeyData != Keys.Return && e.KeyData != Keys.Left)
                {
                    return;
                }
                this.Collapse(tvi);
            }
        }
Пример #2
0
 private void Collapse(TransactionViewItem tvi)
 {
     for (int index = 0; index < tvi.Transaction.Fills.Count; ++index)
     {
         this.TransactionsViewItems.RemoveAt(tvi.Index + 1);
     }
     tvi.ImageIndex = 0;
     this.ltvTransactions.VirtualListSize = this.TransactionsViewItems.Count;
 }
Пример #3
0
 private void Expand(TransactionViewItem tvi)
 {
     for (int index = 0; index < tvi.Transaction.Fills.Count; ++index)
     {
         this.TransactionsViewItems.Insert(tvi.Index + index + 1, (ListViewItem) new FillViewItem(tvi.Transaction.Fills[index]));
     }
     tvi.ImageIndex = 1;
     this.ltvTransactions.VirtualListSize = this.TransactionsViewItems.Count;
 }
Пример #4
0
        private void ltvTransactions_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            TransactionViewItem tvi = this.ltvTransactions.GetItemAt(e.X, e.Y) as TransactionViewItem;

            if (tvi == null)
            {
                return;
            }
            if (tvi.ImageIndex == 0)
            {
                this.Expand(tvi);
            }
            else
            {
                if (tvi.ImageIndex != 1)
                {
                    return;
                }
                this.Collapse(tvi);
            }
        }
Пример #5
0
 private void Collapse(TransactionViewItem tvi)
 {
   for (int index = 0; index < tvi.Transaction.Fills.Count; ++index)
     this.TransactionsViewItems.RemoveAt(tvi.Index + 1);
   tvi.ImageIndex = 0;
   this.ltvTransactions.VirtualListSize = this.TransactionsViewItems.Count;
 }
Пример #6
0
 private void Expand(TransactionViewItem tvi)
 {
   for (int index = 0; index < tvi.Transaction.Fills.Count; ++index)
     this.TransactionsViewItems.Insert(tvi.Index + index + 1, (ListViewItem) new FillViewItem(tvi.Transaction.Fills[index]));
   tvi.ImageIndex = 1;
   this.ltvTransactions.VirtualListSize = this.TransactionsViewItems.Count;
 }