Exemplo n.º 1
0
        public Form2(TenkeyController controller)
        {
            InitializeComponent();
            InitButton();

            this.controller = controller;

            MapList = new List <KeyMap>();
            foreach (KeyMap map in controller.GetKeyMapList())
            {
                MapList.Add((KeyMap)map.Clone());
            }

            cmbKeyMapList.Items.AddRange(MapList.ToArray());
            cmbKeyMapList.SelectedIndex = 0;
            tbMapName.Text = ((KeyMap)cmbKeyMapList.SelectedItem).Name;
        }
Exemplo n.º 2
0
        private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
        {
            List <KeyMap> maplist = controller.GetKeyMapList();

            contextMenuStrip1.Items.Clear();
            foreach (KeyMap map in maplist)
            {
                ToolStripMenuItem item = new ToolStripMenuItem(map.Name, null, keyMapStripMenuItem_Click);
                item.Checked = map.InUse;
                contextMenuStrip1.Items.Add(item);
            }
            contextMenuStrip1.Items.Add(new ToolStripSeparator());
            contextMenuStrip1.Items.Add(new ToolStripMenuItem("Save", null, save_Click));
            contextMenuStrip1.Items.Add(new ToolStripMenuItem("Load Default", null, load_Click));
            contextMenuStrip1.Items.Add(new ToolStripSeparator());
            contextMenuStrip1.Items.Add(new ToolStripMenuItem("Settings", null, settingsToolStripMenuItem_Click));
            contextMenuStrip1.Items.Add(new ToolStripSeparator());
            contextMenuStrip1.Items.Add(new ToolStripMenuItem("Exit", null, exit_Click));
        }