Exemple #1
0
        public void StartStop()
        {
            if (!this.InProgress)
            {
                this.InProgress = true;
                this.State      = ProcessState.UNKNOWN;

                Task task = new Task(delegate { this.model.ProcessContainerTask(this.currentTab); });
                task.Start();
            }
            else
            {
                var result = MessageBox.Show("Do you really want to force abort main process thread?\n\nIt is not recommended to break firmware ops, as the device will most likely not work correctly! Moreover, aborting thread which uses unmanaged resources will surely cause memory and that could make system unstable.", "BSL430.NET", MessageBoxButton.YesNo, MessageBoxImage.Warning);

                if (result == MessageBoxResult.Yes)
                {
                    try
                    {
                        BSL430NET.Interrupt();
                    }
                    catch (Exception) { }
                }
            }
        }