Exemple #1
0
 private void OnLoaded(object sender, RoutedEventArgs e)
 {
     try
     {
         configFinder = new MyroConfigFinder(Params.ConfigPath);
         rebuildConfigList();
     }
     catch (Exception err)
     {
         GUIUtilities.ReportUnexpectedException(err);
         this.Close();
     }
 }
Exemple #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);
        }
Exemple #3
0
        private void displayJewelRobotChooser()
        {
            if (robotChooserMenu == null || robotChooserMenu.IsOpen == false)
            {
                JewelButton.SetValue(CheckBox.IsCheckedProperty, true);

                robotChooserMenu = new ContextMenu()
                {
                    PlacementTarget = JewelButton,
                    Placement       = PlacementMode.Relative,
                    VerticalOffset  = JewelButton.ActualHeight
                };
                robotChooserMenu.Closed += delegate
                {
                    robotChooserMenu = null;
                    JewelButton.SetValue(CheckBox.IsCheckedProperty, false);
                };
                var finder = new MyroConfigFinder(Myro.Utilities.Params.ConfigPath);
                foreach (var config in finder.FindConfigFiles())
                {
                    MenuItem menuitem = new MenuItem()
                    {
                        Header = finder.MakeListItem(config),
                    };
                    var myConfig = config;
                    menuitem.Click += delegate { CurrentConfig = myConfig; };
                    robotChooserMenu.Items.Add(menuitem);
                }

                robotChooserMenu.IsOpen = true;
            }
            else
            {
                robotChooserMenu.IsOpen = false;
            }
        }
Exemple #4
0
 private void OnInitialized(object sender, EventArgs e)
 {
     configFinder = new MyroConfigFinder(Params.ConfigPath);
     rebuildConfigList();
 }