Exemplo n.º 1
0
        void EditBots()
        {
            if (listView1.CheckedItems.Count > 0)
            {
                foreach (ListViewItem item in listView1.CheckedItems)
                {
                    var rp = new RobotProperties();
                    rp.Script         = item.SubItems[0].Text;
                    rp.Priority       = RobotsConfigTools.GetProcessPriorityFromName(item.SubItems[1].Text);
                    rp.Texture        = item.SubItems[2].Text;
                    m_RobotProperties = null;
                    EditRobot(rp);
                    if (null != m_RobotProperties)
                    {
                        listView1.Items[listView1.Items.IndexOf(item)].SubItems[0].Text = m_RobotProperties.Script;
                        listView1.Items[listView1.Items.IndexOf(item)].SubItems[1].Text = m_RobotProperties.Priority.ToString();
                        listView1.Items[listView1.Items.IndexOf(item)].SubItems[2].Text = m_RobotProperties.Texture;
                    }
                }

                m_RobotsPropertiesList.Clear();
                foreach (ListViewItem item in listView1.Items)
                {
                    var rp = new RobotProperties(item.SubItems[0].Text, item.SubItems[2].Text, RobotsConfigTools.GetProcessPriorityFromName(item.SubItems[1].Text));

                    m_RobotsPropertiesList.Add(rp);
                }
            }
        }
Exemplo n.º 2
0
        void DeleteBots()
        {
            if (listView1.CheckedItems.Count > 0)
            {
                foreach (ListViewItem item in listView1.CheckedItems)
                {
                    listView1.Items.Remove(item);
                }

                m_RobotsPropertiesList.Clear();
                foreach (ListViewItem item in listView1.Items)
                {
                    var rp = new RobotProperties(item.SubItems[0].Text, item.SubItems[2].Text, RobotsConfigTools.GetProcessPriorityFromName(item.SubItems[1].Text));

                    m_RobotsPropertiesList.Add(rp);
                }
            }
        }
Exemplo n.º 3
0
        private void comboBoxPriority_SelectionChangeCommitted(object sender, EventArgs e)
        {
            ComboBox list = ((ComboBox)sender);

            m_RobotProperties.Priority = RobotsConfigTools.GetProcessPriorityFromName((string)list.Items[list.SelectedIndex]);
        }