Esempio n. 1
0
        private void rebuildConfigList()
        {
            int oldIndex = ConfigList.SelectedIndex;

            ConfigList.Items.Clear();
            configFiles = configFinder.FindConfigFiles();
            foreach (var c in configFiles)
            {
                ConfigList.Items.Add(MyroConfigGUI.MakeListItem(c));
            }
            if (oldIndex < ConfigList.Items.Count)
            {
                ConfigList.SelectedIndex = oldIndex;
            }
        }
Esempio n. 2
0
        private List <MenuItem> makeConfigMenuItems()
        {
            var ret    = new List <MenuItem>();
            var finder = new MyroConfigFinder(Myro.Utilities.Params.ConfigPath);

            foreach (var config in finder.FindConfigFiles())
            {
                MenuItem menuitem = new MenuItem()
                {
                    Header = MyroConfigGUI.MakeListItem(config),
                };
                var myConfig = config;
                menuitem.Click += delegate
                {
                    RobotChange.Invoke(this, new RobotChangeEventArgs()
                    {
                        ConfigFiles = myConfig
                    });
                };
                ret.Add(menuitem);
            }
            return(ret);
        }