/// <summary> /// Compares the expected colour with the actual colour returned from /// the xml element (typically a KeyWords element). /// </summary> void AssertAreHighlightColorsEqual(Color color, bool bold, XmlElement element) { HighlightColor expectedColor = new HighlightColor(color, bold, false); HighlightColor actualColor = new HighlightColor(element); Assert.AreEqual(expectedColor.ToString(), actualColor.ToString()); }
internal void SetImageArtifacts(IMagickImage image) { if (HighlightColor != null) { image.SetArtifact("compare:highlight-color", HighlightColor.ToString()); } if (LowlightColor != null) { image.SetArtifact("compare:lowlight-color", LowlightColor.ToString()); } if (MasklightColor != null) { image.SetArtifact("compare:masklight-color", MasklightColor.ToString()); } }
string GetStyle(TextWord word) { if (word.SyntaxColor == null || word.SyntaxColor.ToString() == currentDefaultTextColor.ToString()) { return(null); } string style = "color: " + ColorToString(word.Color) + ";"; if (word.Bold) { style += " font-weight: bold;"; } if (word.Italic) { style += " font-style: italic;"; } if (word.SyntaxColor.HasBackground) { style += " background-color: " + ColorToString(word.SyntaxColor.BackgroundColor) + ";"; } return(style); }
public override void AddItem(string result) { if (!EditMode && bool.Parse(result)) { if (!String.IsNullOrEmpty(GameLocation)) { ContextMenuMap.Add(new ContextMenuItem("Open Directory", Path.GetDirectoryName(GameLocation))); } var game = new VideoGame(Title, Path.GetFileName(ImageLocation), EdgeColor.ToString(), MiddleColor.ToString(), HighlightColor.ToString(), GameLocation, TargetParameters, true); game.ContextMenuMap = this.ContextMenuMap; OnItemAdded?.Invoke(this, new DialogRoutedEventArgs() { Object = game }); } else { OnItemAdded?.Invoke(this, new DialogRoutedEventArgs() { Object = null }); } }
public static Brush ConvertFrom(HighlightColor color) { return(new SolidColorBrush((Color)ColorConverter.ConvertFromString(color.ToString()))); }
public HighlightBrush(HighlightColor color) { eColor = color; Color = (Color)ColorConverter.ConvertFromString(color.ToString()); Brush = new SolidColorBrush(Color); }
public void DigitsColor() { HighlightColor expectedColor = new HighlightColor(Color.DarkBlue, false, false); Assert.AreEqual(expectedColor.ToString(), highlightingStrategy.DigitColor.ToString()); }
public void CharSpanColor() { HighlightColor expectedColor = new HighlightColor(Color.Magenta, false, false); Assert.AreEqual(expectedColor.ToString(), charSpan.Color.ToString()); }
public void StringSpanColor() { HighlightColor expectedColor = new HighlightColor(Color.Blue, false, false); Assert.AreEqual(expectedColor.ToString(), stringSpan.Color.ToString()); }
public void SingleQuoteDocCommentSpanColor() { HighlightColor expectedColor = new HighlightColor(Color.Green, false, false); Assert.AreEqual(expectedColor.ToString(), singleQuoteDocCommentSpan.Color.ToString()); }
public void LineCommentSpanColor() { HighlightColor expectedColor = new HighlightColor(Color.Green, false, false); Assert.AreEqual(expectedColor.ToString(), lineCommentSpan.Color.ToString()); }