Beispiel #1
0
        private void Tool_Click(object sender, RoutedEventArgs e)
        {
            var settingWindow = new SettingMaker();

            settingWindow.ShowDialog();
            if (settingWindow.FilePath != null)
            {
                ProgramSetting.SensorConfPath = settingWindow.FilePath;
                ConfPath.GetBindingExpression(System.Windows.Controls.TextBox.TextProperty).UpdateTarget();
            }
        }
Beispiel #2
0
        private void SensorSettingBrowse_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog
            {
                Filter = "Setting files (*.json)|*.json"
            };

            if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string SensorInfoString = File.ReadAllText(openFileDialog.FileName);
                try
                {
                    List <SensorInfo> sensorInfos = JsonConvert.DeserializeObject <List <SensorInfo> >(SensorInfoString);
                }
                catch (JsonSerializationException)
                {
                    System.Windows.MessageBox.Show("Can not read setting file. Please choose correct file.");
                    return;
                }
                ProgramSetting.SensorConfPath = openFileDialog.FileName;
                ConfPath.GetBindingExpression(System.Windows.Controls.TextBox.TextProperty).UpdateTarget();
            }
        }
 public MediaResolver(ConfPath config)
 {
     this.config = config;
 }
Beispiel #4
0
 public MediaFactory(ConfPath config)
 {
     this.config = config;
 }