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