Пример #1
0
        private void OnLoadTemplate()
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter = "JSON (*.json)|*.json";
            if (ofd.ShowDialog() == true)
            {
                foreach (var dm in JsonConvert.DeserializeObject <List <DoseMetricModel> >(File.ReadAllText(ofd.FileName)))
                {
                    var dmm = new DoseMetricModel(_plan)
                    {
                        InputUnit   = dm.InputUnit,
                        InputUnits  = dm.InputUnits,
                        InputValue  = dm.InputValue,
                        Metric      = dm.Metric,
                        OutputUnit  = dm.OutputUnit,
                        OutputUnits = dm.OutputUnits,
                        Structure   = dm.Structure,
                        Tolerance   = dm.Tolerance
                    };
                    dmm.GetOutputValue();
                    _eventAggregator.GetEvent <AddDoseMetricEvent>().Publish(dmm);
                }
            }
        }
 private void OnAddDoseMetric(DoseMetricModel dm)
 {
     DoseMetrics.Add(dm);
 }
Пример #3
0
 private void OnAddMetric(DoseMetricModel obj)
 {
     DoseMetrics.Add(obj);
 }