Пример #1
0
        //show the FRED add instrument window
        private void AddInstrumentFredBtn_OnClick(object sender, RoutedEventArgs e)
        {
            var window = new AddInstrumentFredWindow(_client);

            window.ShowDialog();

            if (window.ViewModel.AddedInstruments != null)
            {
                foreach (Instrument i in window.ViewModel.AddedInstruments)
                {
                    ViewModel.Instruments.Add(i);
                }
                window.Close();
            }
        }
Пример #2
0
        //show the FRED add instrument window
        private void AddInstrumentFredBtn_OnClick(object sender, RoutedEventArgs e)
        {
            using (var context = new MyDBContext())
            {
                var window = new AddInstrumentFredWindow(context);

                if (window.AddedInstruments != null)
                {
                    foreach (Instrument i in window.AddedInstruments)
                    {
                        Instruments.Add(i);
                    }
                    window.Close();
                }
            }
        }
Пример #3
0
        //show the FRED add instrument window
        private void AddInstrumentFredBtn_OnClick(object sender, RoutedEventArgs e)
        {
            using (var context = new MyDBContext())
            {
                var window = new AddInstrumentFredWindow(context);

                if (window.AddedInstruments != null)
                {
                    foreach (Instrument i in window.AddedInstruments)
                    {
                        Instruments.Add(i);
                    }
                    window.Close();
                }
            }
        }