Exemplo n.º 1
0
        /// <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());
        }
Exemplo n.º 2
0
        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());
            }
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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
                });
            }
        }
Exemplo n.º 5
0
 public static Brush ConvertFrom(HighlightColor color)
 {
     return(new SolidColorBrush((Color)ColorConverter.ConvertFromString(color.ToString())));
 }
Exemplo n.º 6
0
 public HighlightBrush(HighlightColor color)
 {
     eColor = color;
     Color  = (Color)ColorConverter.ConvertFromString(color.ToString());
     Brush  = new SolidColorBrush(Color);
 }
Exemplo n.º 7
0
        public void DigitsColor()
        {
            HighlightColor expectedColor = new HighlightColor(Color.DarkBlue, false, false);

            Assert.AreEqual(expectedColor.ToString(), highlightingStrategy.DigitColor.ToString());
        }
Exemplo n.º 8
0
        public void CharSpanColor()
        {
            HighlightColor expectedColor = new HighlightColor(Color.Magenta, false, false);

            Assert.AreEqual(expectedColor.ToString(), charSpan.Color.ToString());
        }
Exemplo n.º 9
0
        public void StringSpanColor()
        {
            HighlightColor expectedColor = new HighlightColor(Color.Blue, false, false);

            Assert.AreEqual(expectedColor.ToString(), stringSpan.Color.ToString());
        }
Exemplo n.º 10
0
        public void SingleQuoteDocCommentSpanColor()
        {
            HighlightColor expectedColor = new HighlightColor(Color.Green, false, false);

            Assert.AreEqual(expectedColor.ToString(), singleQuoteDocCommentSpan.Color.ToString());
        }
Exemplo n.º 11
0
        public void LineCommentSpanColor()
        {
            HighlightColor expectedColor = new HighlightColor(Color.Green, false, false);

            Assert.AreEqual(expectedColor.ToString(), lineCommentSpan.Color.ToString());
        }