Example #1
0
        //============================================================================*
        // Comparer()
        //============================================================================*

        public static int Comparer(cTransaction Transaction1, cTransaction Transaction2)
        {
            if (Transaction1 == null)
            {
                if (Transaction2 != null)
                {
                    return(-1);
                }
                else
                {
                    return(0);
                }
            }
            else
            {
                if (Transaction2 == null)
                {
                    return(1);
                }
            }

            return(Transaction1.CompareTo(Transaction2));
        }
Example #2
0
        //============================================================================*
        // AddTransaction()
        //============================================================================*

        public ListViewItem AddTransaction(cTransaction Transaction, bool fSelect = false)
        {
            if (!Verify(Transaction))
            {
                return(null);
            }

            //----------------------------------------------------------------------------*
            // Create and Add the Item
            //----------------------------------------------------------------------------*

            ListViewItem Item = new ListViewItem();

            SetTransactionData(Item, Transaction);

            AddItem(Item, fSelect);

            if (Transaction.CompareTo(m_DataFiles.Preferences.LastTransactionSelected) == 0)
            {
                Item.Selected = true;
            }

            return(Item);
        }