//============================================================================* // cTransactionList() - Copy Constructor //============================================================================* public cTransactionList(cTransactionList TransactionList) { foreach (cTransaction Transaction in TransactionList) { Add(new cTransaction(Transaction)); } }
//============================================================================* // cTransactionListView() - Constructor //============================================================================* public cTransactionListView(cTransactionList TransactionList, cDataFiles DataFiles, cSupply Supply = null) : base(DataFiles, cPreferences.eApplicationListView.TransactionsListView) { m_TransactionList = TransactionList; m_DataFiles = DataFiles; m_Supply = Supply; //----------------------------------------------------------------------------* // Set Properties //----------------------------------------------------------------------------* DoubleBuffered = true; CheckBoxes = true; Font = new System.Drawing.Font(Font, System.Drawing.FontStyle.Bold); //----------------------------------------------------------------------------* // Event Handlers //----------------------------------------------------------------------------* ListViewItemSorter = new cListViewTransactionComparer(m_DataFiles.Preferences.TransactionSortColumn, m_DataFiles.Preferences.TransactionSortOrder); //----------------------------------------------------------------------------* // Populate Columns and Groups //----------------------------------------------------------------------------* SortingOrder = m_DataFiles.Preferences.TransactionSortOrder; SortingColumn = m_DataFiles.Preferences.TransactionSortColumn; if (m_Supply != null && m_Supply.SupplyType == cSupply.eSupplyTypes.Powder) { m_arColumns[3].Text += String.Format(" ({0}s)", cDataFiles.MetricString(cDataFiles.eDataType.CanWeight)); } m_arColumns[4].Text += String.Format(" ({0})", m_DataFiles.Preferences.Currency); m_arColumns[5].Text += String.Format(" ({0})", m_DataFiles.Preferences.Currency); m_arColumns[6].Text += String.Format(" ({0})", m_DataFiles.Preferences.Currency); m_arColumns[7].Text += String.Format(" ({0})", m_DataFiles.Preferences.Currency); m_arColumns[8].Text += String.Format(" ({0})", m_DataFiles.Preferences.Currency); PopulateColumns(m_arColumns); //----------------------------------------------------------------------------* // Populate Data //----------------------------------------------------------------------------* Populate(); Initialized = true; }