Example #1
0
        private void WriteFlashCommand(object sender, ExecutedRoutedEventArgs e)
        {
            var msgResult = MessageBox.Show("Are you sure you want start writing flash. Device may become unoperable", "Flash confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (msgResult == MessageBoxResult.Yes)
            {
                if (_model.Config.AutoErase)
                {
                    var eraseDlg = new EraseDeviceWindow {
                        DataContext = new FlasherOperationModel(_model),
                        Owner       = this
                    };
                    if (eraseDlg.ShowDialog() != true)
                    {
                        return;
                    }
                }

                var writeDlg = new WriteFlashWindow {
                    DataContext = new FlasherOperationModel(Model),
                    Owner       = this
                };
                if (writeDlg.ShowDialog() == true && _model.Config.AutoVerify)
                {
                    VerifyFlashCommand(this, null);
                }
                ;
            }
        }
Example #2
0
        private void WriteDeviceCommand(object sender, ExecutedRoutedEventArgs e)
        {
            var msgResult = MessageBox.Show("Are you sure you want start writing to the device. All previous data will be lost", "Write confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (msgResult == MessageBoxResult.Yes)
            {
                if (_model.Config.AutoErase)
                {
                    var eraseDlg = new EraseDeviceWindow {
                        DataContext = new FlasherOperationModel(_model),
                        Owner       = this
                    };
                    if (eraseDlg.ShowDialog() != true)
                    {
                        return;
                    }
                }

                var writeDlg = new WriteDeviceWindow {
                    DataContext = new FlasherOperationModel(_model),
                    Owner       = this
                };
                var writeResult = writeDlg.ShowDialog();
                if (writeResult == true && _model.Config.AutoVerify)
                {
                    VerifyDeviceCommand(this, null);
                }
            }
        }
Example #3
0
        private void EraseDeviceCommand(object sender, ExecutedRoutedEventArgs e)
        {
            var msgResult = MessageBox.Show("Are you sure you want start erasing the device. All previous data will be lost", "Erase confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (msgResult == MessageBoxResult.Yes)
            {
                var dlg = new EraseDeviceWindow {
                    DataContext = new FlasherOperationModel(_model),
                    Owner       = this
                };
                dlg.ShowDialog();
            }
        }