Exemplo n.º 1
0
        private void BotList_DragDrop(object sender, DragEventArgs e)
        {
            string file = (string)e.Data.GetData(typeof(string));

            BotPropDlg dlg = new BotPropDlg(file);
            dlg.ShowDialog(this.Parent);

            if (dlg.DialogResult == DialogResult.OK)
            {
                AppContext.BotList.AddBot(dlg.BotDesc);
            }
        }
Exemplo n.º 2
0
        private void modifyMenuItem_Click(object sender, EventArgs e)
        {
            if (BotList.SelectedItems.Count == 0)
                return;

            BotEngine.BotDescriptor bot = (BotEngine.BotDescriptor)BotList.SelectedItems[0].Tag;

            BotPropDlg dlg = new BotPropDlg(bot);
            if (dlg.ShowDialog(this.Parent) != DialogResult.OK)
            {
                return;
            }

            if (bot.Running)
            {

                if (false == AppContext.BotEngine.Run(bot))
                {
                    AppContext.WriteLog("Failed to restart bot " + bot.Name);
                }
            }

            UpdateFromList();
        }
Exemplo n.º 3
0
        private void runToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TreeNode node = TemplateTree.SelectedNode;

            if (node != null)
            {
                BotPropDlg dlg = new BotPropDlg((string)GetNodeValue(node));
                dlg.ShowDialog(this.Parent);

                if (dlg.DialogResult == DialogResult.OK)
                {
                    AppContext.BotList.AddBot(dlg.BotDesc);
                }
            }
        }