private void updateData() { SubsidiaryCompany company = this.company; base.SubItems.Clear(); base.Text = company.owner.name; base.SubItems.Add(util.CurrencyUtil.format(company.currentMarketPrice)); base.SubItems.Add(util.CurrencyUtil.format(company.profit)); base.SubItems.Add(util.CurrencyUtil.format(company.sales)); base.SubItems.Add(util.CurrencyUtil.format(company.cost)); }
private void onRemoved(SubsidiaryMarket m, SubsidiaryCompany company) { if (m != market) { return; // ignore } ListViewItemEx item = (ListViewItemEx)companies[company]; companies.Remove(company); list.Items.Remove(item); }
private void onAdded(SubsidiaryMarket m, SubsidiaryCompany company) { if (m != market) { return; // ignore } ListViewItem item = new ListViewItemEx(company); list.Items.Insert(0, item); companies.Add(company, item); }
/// <summary> /// Shouldn't be called from outside the package. /// </summary> internal void add(SubsidiaryCompany company) { onSale.add(company); if (persistentEvents.onAdded != null) { persistentEvents.onAdded(this, company); } if (volatileEvents.onAdded != null) { volatileEvents.onAdded(this, company); } }
/// <summary> /// Shouldn't be called from outside the package. /// </summary> internal void remove(SubsidiaryCompany company) { onSale.remove(company); if (persistentEvents.onRemoved != null) { persistentEvents.onRemoved(this, company); } if (volatileEvents.onRemoved != null) { volatileEvents.onRemoved(this, company); } }
/// <summary> /// Shouldn't be called from outside the package. /// </summary> internal bool contains(SubsidiaryCompany company) { return(onSale.contains(company)); }
internal ListViewItemEx(SubsidiaryCompany company) { base.Tag = company; company.onPriceChangedV += new EventHandler(onChanged); updateData(); }