private void MenuItem_Click_1(object sender, RoutedEventArgs e)
        {
            var dlg = new CommonOpenFileDialog();

            dlg.Title                   = "Choose BFF file";
            dlg.IsFolderPicker          = false;
            dlg.AllowNonFileSystemItems = true;
            dlg.EnsureFileExists        = true;
            dlg.EnsurePathExists        = true;
            dlg.EnsureReadOnly          = false;
            dlg.EnsureValidNames        = true;
            dlg.Multiselect             = false;
            dlg.ShowPlacesList          = true;
            dlg.Filters.Add(new CommonFileDialogFilter("Balance File Format", "bff,json"));

            if (dlg.ShowDialog() == CommonFileDialogResult.Ok)
            {
                var JsonO = JObject.Parse(File.ReadAllText(dlg.FileName));

                this.DataContext = JsonO;
                JSONFile         = JsonO;
                if (JSONFile.gaparams.extra_use_predictor != null && JSONFile.gaparams.extra_use_predictor.Value == true)
                {
                    PredictorHelper.ApplyPredictorPropertiesToJsonDynamicAndReturnObjects(JSONFile, (string)JSONFile.gaparams.string_PredictorType);
                }
            }
        }
Esempio n. 2
0
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (values == null)
            {
                return(null);
            }

            if (values[0] is string)
            {
                return(PredictorHelper.ApplyPredictorPropertiesToJsonDynamicAndReturnObjects(MainWindow.JSONFile, (string)values[0]));
            }
            else
            {
                return(null);
            }
        }