示例#1
0
        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();
        }
示例#2
0
        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;
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
        /// <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);
        }