Example #1
0
            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));
            }
Example #2
0
        private void onRemoved(SubsidiaryMarket m, SubsidiaryCompany company)
        {
            if (m != market)
            {
                return;                                 // ignore
            }
            ListViewItemEx item = (ListViewItemEx)companies[company];

            companies.Remove(company);
            list.Items.Remove(item);
        }
Example #3
0
        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);
        }
Example #4
0
 /// <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);
     }
 }
Example #5
0
 /// <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);
     }
 }
Example #6
0
 /// <summary>
 /// Shouldn't be called from outside the package.
 /// </summary>
 internal bool contains(SubsidiaryCompany company)
 {
     return(onSale.Contains(company));
 }
Example #7
0
 internal ListViewItemEx(SubsidiaryCompany company)
 {
     base.Tag = company;
     company.onPriceChangedV += new EventHandler(onChanged);
     updateData();
 }