public InfoAboutWindows(Bank b)
        {
            InitializeComponent();
            bank = b;
            Iterator iterator = bank.getBankWindows().createIterator();
            while (iterator.hasNext())
            {
                BankWindowComponent component = (BankWindowComponent)iterator.Next();
                try
                {
                    if (component.GetType() == typeof(BankWindow))
                    {
                        this.comboBoxNumberWindow.Items.Add(component.getNumber());
                    }
                }
                catch (NotImplementedException) { }
            }
            bank.getBankWindows().deleteIterator();

            /*
            List<BankWindow> bankWindows = this.bank.getListBankWindows();
            for(int i = 0; i < bankWindows.Count; i++)
            {
                this.comboBoxNumberWindow.Items.Add(bankWindows[i].getNumber());
            }       */
        }
Пример #2
0
        //действия при загрузке окна
        private void Form1_Load(object sender, EventArgs e)
        {
            this.bank = new Bank();
            this.pictureBankWindows = new List<PictureBox>();
            this.pictureClientQueue = new PictureBox();
            this.pictureClients = new List<PictureBox>();
            this.toolTipBankWindows = new List<ToolTip>();
            this.toolTipClientQueue = new ToolTip();
            this.toolTipClients = new List<ToolTip>();

            /*//создаем окна
            List<int> operations = new List<int>();

            operations.Add(Credit.CREDIT);
            operations.Add(Deposit.DEPOSIT);
            this.bank.addBankWindow(operations);
            */
            PictureBox pictureBox1 = new PictureBox();
            pictureBox1.Name = "bankWindow1";
            pictureBox1.Image = Properties.Resources.BankWindow;
            pictureBox1.Location = new System.Drawing.Point(20, 17);
            pictureBox1.Size = new System.Drawing.Size(55, 55);
            pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;

            this.pictureBankWindows.Add(pictureBox1);
            /*
            operations.Add(Card.CARD);
            this.bank.addBankWindow(operations);
            */
            PictureBox pictureBox2 = new PictureBox();
            pictureBox2.Name = "bankWindow2";
            pictureBox2.Image = Properties.Resources.BankWindow;
            pictureBox2.Location = new System.Drawing.Point(105, 17);
            pictureBox2.Size = new System.Drawing.Size(55, 55);
            pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;

            this.pictureBankWindows.Add(pictureBox2);

            /*
            operations.Clear();
            operations.Add(Payment.PAYMENT);
            operations.Add(Transfer.TRANSFER);
            operations.Add(CurrencyExchangeAdapter.CURRENCYEXCHANGE);
            this.bank.addBankWindow(operations);
            */
            PictureBox pictureBox3 = new PictureBox();
            pictureBox3.Name = "bankWindow3";
            pictureBox3.Image = Properties.Resources.BankWindow;
            pictureBox3.Location = new System.Drawing.Point(190, 17);
            pictureBox3.Size = new System.Drawing.Size(55, 55);
            pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;

            this.pictureBankWindows.Add(pictureBox3);
            /*
            operations.Clear();
            operations.Add(Deposit.DEPOSIT);
            operations.Add(Transfer.TRANSFER);
            this.bank.addBankWindow(operations);
            */
            PictureBox pictureBox4 = new PictureBox();
            pictureBox4.Name = "bankWindow4";
            pictureBox4.Image = Properties.Resources.BankWindow;
            pictureBox4.Location = new System.Drawing.Point(275, 17);
            pictureBox4.Size = new System.Drawing.Size(55, 55);
            pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;

            this.pictureBankWindows.Add(pictureBox4);
            /*
            operations.Add(Card.CARD);
            this.bank.addBankWindow(operations);
            */
            PictureBox pictureBox5 = new PictureBox();
            pictureBox5.Name = "bankWindow5";
            pictureBox5.Image = Properties.Resources.BankWindow;
            pictureBox5.Location = new System.Drawing.Point(360, 17);
            pictureBox5.Size = new System.Drawing.Size(55, 55);
            pictureBox5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;

            this.pictureBankWindows.Add(pictureBox5);

            for (int i = 0; i < this.pictureBankWindows.Count; i++)
            {
                this.panel1.Controls.Add(this.pictureBankWindows[i]);
            }

            //создаем картинку очереди
            this.pictureClientQueue.Name = "ClientQueue";
            this.pictureClientQueue.Image = Properties.Resources.ClientQueue;
            this.pictureClientQueue.Location = new System.Drawing.Point(20, 230);
            this.pictureClientQueue.Size = new System.Drawing.Size(450, 55);
            this.pictureClientQueue.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
            this.panel1.Controls.Add(this.pictureClientQueue);

            //создаем всплывающие подсказки для очереди
            this.toolTipClientQueue.ToolTipTitle = "Очередь";
            this.toolTipClientQueue.ToolTipIcon = ToolTipIcon.Info;
            this.toolTipClientQueue.SetToolTip(this.pictureClientQueue,"");

            //создаем всплывающие подсказки для окон
            for(int i = 0; i<this.pictureBankWindows.Count; i++)
            {
                ToolTip toolTip1 = new ToolTip();
                toolTip1.ToolTipTitle = "Окно № " + (i+1);
                toolTip1.ToolTipIcon = ToolTipIcon.Info;
                toolTip1.SetToolTip(this.pictureBankWindows[i], "");
                this.toolTipBankWindows.Add(toolTip1);
            }

            //создаем картики для клиентов
            PictureBox pictureClient1 = new PictureBox();
            pictureClient1.Name = "Client1";
            pictureClient1.Location = new System.Drawing.Point(20, 92);
            pictureClient1.Size = new System.Drawing.Size(55, 55);
            pictureClient1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;

            this.pictureClients.Add(pictureClient1);

            PictureBox pictureClient2 = new PictureBox();
            pictureClient2.Name = "Client2";
            pictureClient2.Location = new System.Drawing.Point(105, 92);
            pictureClient2.Size = new System.Drawing.Size(55, 55);
            pictureClient2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;

            this.pictureClients.Add(pictureClient2);

            PictureBox pictureClient3 = new PictureBox();
            pictureClient3.Name = "Client3";
            pictureClient3.Location = new System.Drawing.Point(190, 92);
            pictureClient3.Size = new System.Drawing.Size(55, 55);
            pictureClient3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;

            this.pictureClients.Add(pictureClient3);

            PictureBox pictureClient4 = new PictureBox();
            pictureClient4.Name = "Client4";
            pictureClient4.Location = new System.Drawing.Point(275, 92);
            pictureClient4.Size = new System.Drawing.Size(55, 55);
            pictureClient4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;

            this.pictureClients.Add(pictureClient4);

            PictureBox pictureClient5 = new PictureBox();
            pictureClient5.Name = "Client5";
            pictureClient5.Location = new System.Drawing.Point(360, 92);
            pictureClient5.Size = new System.Drawing.Size(55, 55);
            pictureClient5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;

            this.pictureClients.Add(pictureClient5);

            for (int i = 0; i < this.pictureClients.Count; i++)
            {
                this.panel1.Controls.Add(this.pictureClients[i]);
            }

            //создаем всплывающие подсказки для клиентов
            for (int i = 0; i < this.pictureClients.Count; i++)
            {
                ToolTip toolTip1 = new ToolTip();
                toolTip1.ToolTipIcon = ToolTipIcon.Info;
                toolTip1.SetToolTip(this.pictureClients[i], "");
                this.toolTipClients.Add(toolTip1);
            }

            Iterator iterator = bank.getBankWindows().createIterator();
            while (iterator.hasNext())
            {
                BankWindowComponent component = (BankWindowComponent)iterator.Next();
                try
                {
                    if (component.GetType() == typeof(BankWindow))
                    {
                        this.comboBoxWindow.Items.Add(component.getNumber());
                    }
                }
                catch (NotImplementedException) { }
            }
            bank.getBankWindows().deleteIterator();

            /*
            //заполнить листбокс номерами окон
            List<BankWindow> bankWindows = this.bank.getListBankWindows();
            for (int i = 0; i < bankWindows.Count; i++)
            {
                this.comboBoxWindow.Items.Add(bankWindows[i].getNumber());
            }*/
            this.comboBoxWindow.SelectedIndex = 0; //выбрать первое
        }