private void selectButton_Click(object sender, RoutedEventArgs e)
        {
            if (configsListView.SelectedItems.Count == 0)
            {
                return;
            }
            if (Caller.GetType() == typeof(Runner))
            {
                var config = ((ConfigViewModel)configsListView.SelectedItem).Config;
                var runner = Caller as Runner;

                if (SB.SBSettings.General.LiveConfigUpdates)
                {
                    runner.SetConfig(config);
                }
                else
                {
                    runner.SetConfig(IOManager.CloneConfig(config));
                }
            }
            else if (Caller.GetType() == typeof(UserControlConfig))
            {
                ((UserControlConfig)Caller).Config = (ConfigViewModel)configsListView.SelectedItem;
            }
            ((MainDialog)Parent).Close();
        }
예제 #2
0
 private void selectButton_Click(object sender, RoutedEventArgs e)
 {
     if (configsListView.SelectedItems.Count == 0)
     {
         return;
     }
     if (Caller.GetType() == typeof(Runner))
     {
         if (Globals.obSettings.General.LiveConfigUpdates)
         {
             ((Runner)Caller).SetConfig(((ConfigViewModel)configsListView.SelectedItem).Config);
         }
         else
         {
             ((Runner)Caller).SetConfig(IOManager.CloneConfig(((ConfigViewModel)configsListView.SelectedItem).Config));
         }
     }
     ((MainDialog)Parent).Close();
 }