Esempio n. 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();
        }
Esempio n. 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;
        }