public void HighlightCurrentItem() { System.Windows.Threading.Dispatcher.CurrentDispatcher.VerifyAccess(); HighlightHelper.HighlightCurrentItem(_window, CodeDocumentViewModel); // Force NotifyPropertyChanged CodeDocumentViewModel.CodeDocumentTop = null; }
public void OnlyOneItemShouldBeHighlighted() { var document = SyntaxMapper.MapDocument(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..\\..\\Files\\TestProperties.cs")); HighlightHelper.HighlightCurrentItem(document, 13, Brushes.Red, Brushes.Blue, Brushes.Green, Brushes.White); HighlightHelper.HighlightCurrentItem(document, 18, Brushes.Red, Brushes.Blue, Brushes.Green, Brushes.White); var highlightedItems = new List <CodeItem>(); FindHighlightedItems(highlightedItems, document); Assert.AreEqual(1, highlightedItems.Count); }
public void CurrentItemShouldBeHighlighted() { var document = SyntaxMapper.MapDocument(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..\\..\\Files\\TestProperties.cs")); HighlightHelper.HighlightCurrentItem(document, 13, Brushes.Red, Brushes.Blue, Brushes.Green, Brushes.White); var highlightedClass = (document.First() as IMembers).Members.First() as CodeClassItem; var highlightedItem = highlightedClass.Members[2]; Assert.AreEqual(FontWeights.Bold, highlightedItem.FontWeight); Assert.AreEqual(Brushes.Red, highlightedItem.Foreground); Assert.AreEqual(Brushes.Blue, highlightedItem.HighlightBackground); Assert.AreEqual(Brushes.Green, highlightedClass.BorderBrush); }
public void HighlightCurrentItem() => HighlightHelper.HighlightCurrentItem(_window, CodeDocumentViewModel);
public void HighlightCurrentItem() { System.Windows.Threading.Dispatcher.CurrentDispatcher.VerifyAccess(); HighlightHelper.HighlightCurrentItem(_window, CodeDocumentViewModel); }