public TestSuiteDialog(bool isCreate, TestSuiteVm baseTestSuite, Settings settings) { _baseTestSuite = baseTestSuite; _assembliesChangedTimer = new DispatcherTimer(); _assembliesChangedTimer.Interval = TimeSpan.FromSeconds(1.3); _assembliesChangedTimer.Tick += _assembliesEdit_timer_Tick; _libsChangedTimer = new DispatcherTimer(); _libsChangedTimer.Interval = TimeSpan.FromSeconds(1.3); _libsChangedTimer.Tick += _libsEdit_timer_Tick; DataContext = _model = new TestSuiteCreateOrEditModel(settings, isCreate, baseTestSuite?.DisableSemanticAnalysis ?? false); InitializeComponent(); if (baseTestSuite != null) { _model.RootFolder = baseTestSuite.Solution.RootFolder; _model.SuiteName = baseTestSuite.Name; _model.NormalizedAssemblies = baseTestSuite.Assemblies; _model.NormalizedLibs = baseTestSuite.Libs; if (baseTestSuite.Language != Nitra.Language.Instance) _model.SelectedLanguage = baseTestSuite.Language; } _assemblies.Text = _model.NormalizedAssembliesText; _assemblies.TextChanged += _assemblies_TextChanged; _libs.Text = _model.NormalizedLibsText; _libs.TextChanged += _libs_TextChanged; }
public TestSuiteCreateOrEditModel(Settings settings, bool isCreate) { _settings = settings; IsCreate = isCreate; Title = isCreate ? "New test suite" : "Edit test suite"; RootFolder = Path.GetDirectoryName(_settings.CurrentSolution); Languages = new ObservableCollection<Language>(); DynamicExtensions = new ObservableCollection<DynamicExtensionModel>(); }
public MainWindow() { _settings = Settings.Default; ToolTipService.ShowDurationProperty.OverrideMetadata( typeof(DependencyObject), new FrameworkPropertyMetadata(Int32.MaxValue)); InitializeComponent(); this.Top = _settings.WindowTop; this.Left = _settings.WindowLeft; this.Height = _settings.WindowHeight; this.Width = _settings.WindowLWidth; this.WindowState = (WindowState)_settings.WindowState; _mainRow.Height = new GridLength(_settings.TabControlHeight); _configComboBox.ItemsSource = new[] {"Debug", "Release"}; var config = _settings.Config; _configComboBox.SelectedItem = config == "Release" ? "Release" : "Debug"; _tabControl.SelectedIndex = _settings.ActiveTabIndex; _findGrid.Visibility = System.Windows.Visibility.Collapsed; _foldingStrategy = new NitraFoldingStrategy(); _textBox1Tooltip = new ToolTip { PlacementTarget = _text }; _parseTimer = new Timer { AutoReset = false, Enabled = false, Interval = 300 }; _parseTimer.Elapsed += _parseTimer_Elapsed; _text.TextArea.Caret.PositionChanged += Caret_PositionChanged; _highlightingStyles = new Dictionary<string, HighlightingColor> { { "Keyword", new HighlightingColor { Foreground = new SimpleHighlightingBrush(Colors.Blue) } }, { "Comment", new HighlightingColor { Foreground = new SimpleHighlightingBrush(Colors.Green) } }, { "Number", new HighlightingColor { Foreground = new SimpleHighlightingBrush(Colors.Magenta) } }, { "Operator", new HighlightingColor { Foreground = new SimpleHighlightingBrush(Colors.Navy) } }, { "String", new HighlightingColor { Foreground = new SimpleHighlightingBrush(Colors.Maroon) } }, }; _foldingManager = FoldingManager.Install(_text.TextArea); _textMarkerService = new TextMarkerService(_text.Document); _text.TextArea.TextView.BackgroundRenderers.Add(_textMarkerService); _text.TextArea.TextView.LineTransformers.Add(_textMarkerService); _text.Options.ConvertTabsToSpaces = true; _text.Options.EnableRectangularSelection = true; _text.Options.IndentationSize = 2; _testsTreeView.SelectedValuePath = "FullPath"; LoadTests(); }
public TestSuit(bool create, TestSuitVm baseTestSuit) { _settings = Settings.Default; _create = create; InitializeComponent(); this.Title = create ? "New test suit" : "Edit test suit"; var root = Path.GetFullPath(_settings.TestsLocationRoot); _testsRootTextBlock.Text = root; var paths = baseTestSuit == null ? "" : string.Join(Environment.NewLine, baseTestSuit.SynatxModules.Select(m => Utils.MakeRelativePath(from: root, isFromDir: true, to: m.GetType().Assembly.Location, isToDir: false)).Distinct()); _assemblies.Text = paths; UpdateSyntaxModules(paths, root); _timer.Interval = TimeSpan.FromSeconds(1.3); _timer.Stop(); _timer.Tick += _assembliesEdit_timer_Tick; }
public CreateSolutionDialog() { InitializeComponent(); _settings = Settings.Default; }
public TestsSettingsWindow() { InitializeComponent(); _settings = Settings.Default; }