private static void onNewWorld(object sender, EventArgs a) { BankBusinessHourListener listener = null; if (_theInstance != null) { listener = _theInstance.onBusinesStatusChanging; } _theInstance = (BankModule)World.world.otherObjects["{227E053A-6667-43fe-8CE1-26EB55CE6A56}"]; if (_theInstance == null) { World.world.otherObjects["{227E053A-6667-43fe-8CE1-26EB55CE6A56}"] = _theInstance = new BankModule(); } // restoring listener registrations (may be a BankbookWindow). if (listener != null) { _theInstance.onBusinesStatusChanging = listener; } // restore registrations for BankbookListHelper IEnumerator e1 = _theInstance.debts.GetEnumerator(); BankbookListHelper.restoreData(); }
public BankbookWindow() { InitializeComponent(); if (BankConfig.canBorrow) { BankbookListHelper.buildDebtList(list_loan); } else { tabControl1.Controls.Remove(pgLoan); } if (BankConfig.canDeposit) { BankbookListHelper.buildDepositList(list_cancel); } else { tabControl1.Controls.Remove(pgDeposit); } onBankStatusChanged(); bankListener = new BankBusinessHourListener(onBankStatusChanged); bank.onBusinesStatusChanging += bankListener; }
public void deposit(long amount, TimeLength period) { if (!BankConfig.canDeposit) { return; } double interest = GetDepositInterest(period); Time due = clock + period; FixedDeposit item = new FixedDeposit(amount, interest, due, AccountGenre.OTHERS); deposits.add(item); BankbookListHelper.addNewDeposit(item); _totalDeposit += amount; item.onStatusChanging += new AssetChangeListener(onDepositStatusChanged); }
public void borrow(long amount, TimeLength period) { if (!BankConfig.canBorrow) { return; } double interest = GetDebtInterest(period); Time due = clock + period; DebtEx item = new DebtEx(amount, interest, due, AccountGenre.OTHERS); debts.add(item); BankbookListHelper.addNewDebt(item); _totalDebt += amount; item.onStatusChanging += new AssetChangeListener(onDebtStatusChanged); }
/// <summary> /// 使用されているリソースに後処理を実行します。 /// </summary> protected override void Dispose(bool disposing) { bank.onBusinesStatusChanging -= bankListener; if (disposing) { if (components != null) { components.Dispose(); } } BankbookListHelper.RemoveList(list_cancel); BankbookListHelper.RemoveList(list_loan); base.Dispose(disposing); }