Пример #1
0
        private void btnRun_Click(object sender, RoutedEventArgs e)
        {
            if (!isRunning)
            {
                if (!listTools.HasItems || listTools.SelectedItem == null)
                {
                    this.AddLog(LogType.Warning, "No tool selected!");
                    return;
                }
                Communication.IsPreviewPaused = true;
                ToolBase toolFunction = (listTools.SelectedItem as ToolBase);

                toolFunction.Start();
                currentFunction = toolFunction;

                btnRun.Content = "Stop Tool";
                isRunning      = true;
            }
            else
            {
                currentFunction.Stop();
                Communication.IsPreviewPaused = false;
                btnRun.Content = "Run Selected";
                isRunning      = false;
            }
        }
Пример #2
0
        private void ListTools_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (listTools.SelectedItem == null)
            {
                OptionsPanel.Children.Clear();
                OptionsPanel.InvalidateVisual();
                return;
            }

            ToolBase toolFunction = (listTools.SelectedItem as ToolBase);

            if (toolFunction.Config != null)
            {
                toolFunction.Config.GetOptionsView();
            }
        }