示例#1
0
 private void ButtonNewBot_Click(object sender, RoutedEventArgs e)
 {
     _strategyKeeper.CreateNewBot();
 }
示例#2
0
        private void _grid_Click(object sender, EventArgs e)
        {
            if (_grid.SelectedCells.Count == 0)
            {
                return;
            }
            int coluIndex = _grid.SelectedCells[0].ColumnIndex;

            int rowIndex = _grid.SelectedCells[0].RowIndex;

            /*
             * colum0.HeaderText = "Num";               0
             * colum01.HeaderText = "Name";             1
             * colum02.HeaderText = "Type";             2
             * colum04.HeaderText = "First Security";   3
             * colum05.HeaderText = "Position";         4
             * colum06.HeaderText = "Chart";            5
             * colum07.HeaderText = "Parameters";       6
             * colum09.HeaderText = "Action";           7
             */

            int botsCount = 0;

            if (_master.PanelsArray != null)
            {
                botsCount = _master.PanelsArray.Count;
            }

            BotPanel bot = null;

            if (rowIndex < botsCount)
            {
                bot = _master.PanelsArray[rowIndex];
            }


            if (coluIndex == 5 &&
                rowIndex < botsCount)
            { // вызываем чарт робота
                bot.ShowChartDialog();
            }
            else if (coluIndex == 6 &&
                     rowIndex < botsCount)
            { // вызываем параметры
                bot.ShowParametrDialog();
            }
            else if (coluIndex == 7 &&
                     rowIndex < botsCount)
            { // вызываем окно удаление робота
                _master.DeleteByNum(rowIndex);
            }

            if (coluIndex == 6 &&
                rowIndex == botsCount + 1)
            { // вызываем общий журнал
                _master.ShowCommunityJournal();
            }
            else if (coluIndex == 7 &&
                     rowIndex == botsCount + 1)
            { // вызываем добавление нового бота
                _master.CreateNewBot();
            }
        }