コード例 #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());
        }
コード例 #2
0
ファイル: CompareSettings.cs プロジェクト: weinre/Magick.NET
        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());
            }
        }
コード例 #3
0
ファイル: HtmlWriter.cs プロジェクト: maikebing/_KeelKit
        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);
        }
コード例 #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
                });
            }
        }
コード例 #5
0
 public static Brush ConvertFrom(HighlightColor color)
 {
     return(new SolidColorBrush((Color)ColorConverter.ConvertFromString(color.ToString())));
 }
コード例 #6
0
 public HighlightBrush(HighlightColor color)
 {
     eColor = color;
     Color  = (Color)ColorConverter.ConvertFromString(color.ToString());
     Brush  = new SolidColorBrush(Color);
 }
コード例 #7
0
        public void DigitsColor()
        {
            HighlightColor expectedColor = new HighlightColor(Color.DarkBlue, false, false);

            Assert.AreEqual(expectedColor.ToString(), highlightingStrategy.DigitColor.ToString());
        }
コード例 #8
0
        public void CharSpanColor()
        {
            HighlightColor expectedColor = new HighlightColor(Color.Magenta, false, false);

            Assert.AreEqual(expectedColor.ToString(), charSpan.Color.ToString());
        }
コード例 #9
0
        public void StringSpanColor()
        {
            HighlightColor expectedColor = new HighlightColor(Color.Blue, false, false);

            Assert.AreEqual(expectedColor.ToString(), stringSpan.Color.ToString());
        }
コード例 #10
0
        public void SingleQuoteDocCommentSpanColor()
        {
            HighlightColor expectedColor = new HighlightColor(Color.Green, false, false);

            Assert.AreEqual(expectedColor.ToString(), singleQuoteDocCommentSpan.Color.ToString());
        }
コード例 #11
0
        public void LineCommentSpanColor()
        {
            HighlightColor expectedColor = new HighlightColor(Color.Green, false, false);

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