当前位置: 首页>>代码示例>>C#>>正文


C# SolidColorBrush.ToString方法代码示例

本文整理汇总了C#中System.Windows.Media.SolidColorBrush.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# SolidColorBrush.ToString方法的具体用法?C# SolidColorBrush.ToString怎么用?C# SolidColorBrush.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Media.SolidColorBrush的用法示例。


在下文中一共展示了SolidColorBrush.ToString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GameLogWrite

        public void GameLogWrite(String text, SolidColorBrush brush, TextDecorationCollection decorations)
        {
            // FIXME: probably more invalid characters...
            text = text.Replace((Char)0x17, ' ');
            //text = System.Security.SecurityElement.Escape(text).Replace((Char)0x17, ' ');

            XmlElement run = GameLogCreateXmlElement("Run");
            run.InnerText = text;

            Procedure<String, String> addXmlAttribute = (name, value) =>
            {
                XmlAttribute attribute = gameLog.CreateAttribute(name);
                attribute.InnerXml = value;
                run.Attributes.Append(attribute);
            };

            if (brush != Brushes.Black)
            {
                addXmlAttribute("Foreground", brush.ToString());
            }

            if (decorations != null)
            {
                // TODO: fixme for multiple attributes, what's the XML for that?
                addXmlAttribute("TextDecorations", decorations[0].Location.ToString());
            }

            gameLogParagraph.AppendChild(run);
        }
开发者ID:Traderain,项目名称:coldemoplayer,代码行数:29,代码来源:AnalysisWindowInterface.cs

示例2: AccountBackgroundColour_is_white_when_AccountName_is_valid

        public void AccountBackgroundColour_is_white_when_AccountName_is_valid()
        {
            var transaction = new Transaction(_journal, TransactionDirection.In, _account);
            var vm = new TransactionViewModel(transaction, _mockAccountRepository);

            var white = new SolidColorBrush(Colors.White);
            Assert.AreEqual(white.ToString(), vm.AccountBackgroundColour.ToString());
        }
开发者ID:mattwatson,项目名称:Akcounts,代码行数:8,代码来源:TransactionViewModel_spec.cs

示例3: AccountBackgroundColour_is_pink_when_AccountName_is_invalid

        public void AccountBackgroundColour_is_pink_when_AccountName_is_invalid()
        {
            var transaction = new Transaction(_journal, TransactionDirection.Out, null, 123.45M);
            var vm = new TransactionViewModel(transaction, _mockAccountRepository);

            var pink = new SolidColorBrush(Colors.Pink);
            Assert.AreEqual(pink.ToString(), vm.AccountBackgroundColour.ToString());
        }
开发者ID:mattwatson,项目名称:Akcounts,代码行数:8,代码来源:TransactionViewModel_spec.cs

示例4: SysColorViewModal

        public SysColorViewModal(string name, SolidColorBrush brush, ICopyService copyService)
        {
            if(copyService == null)
            {
                throw new ArgumentNullException("copyService");
            }

            Name = name;
            Data = brush.ToString();
            ColorItem = brush;

            CopyCommand = new CommandHandler(CopyAction, true);
            m_CopyService = copyService;
        }
开发者ID:igsrk,项目名称:systemcolors,代码行数:14,代码来源:SysColorViewModal.cs

示例5: HideDataPointMarker

        /// <summary>
        /// Hides a DataPoint Marker
        /// </summary>
        /// <param name="dataPoint"></param>
        internal static void HideDataPointMarker(DataPoint dataPoint)
        {   
            Brush tarnsparentColor = new SolidColorBrush(Colors.Transparent);
            dataPoint.Marker.MarkerShape.Fill = tarnsparentColor;

            SolidColorBrush stroke = dataPoint.Marker.MarkerShape.Stroke as SolidColorBrush;

            if(!(stroke != null && stroke.Color.ToString().Equals(tarnsparentColor.ToString())))
                dataPoint.Marker.MarkerShape.Stroke = tarnsparentColor;

            if (dataPoint.Marker.MarkerShadow != null)
                dataPoint.Marker.MarkerShadow.Visibility = Visibility.Collapsed;

            if (dataPoint.Marker.BevelLayer != null)
                dataPoint.Marker.BevelLayer.Visibility = Visibility.Collapsed;
        }
开发者ID:zhangzy0193,项目名称:visifire,代码行数:20,代码来源:LineChart.cs

示例6: AmountOutBackgroundColour_is_white_when_AmountOut_is_valid

        public void AmountOutBackgroundColour_is_white_when_AmountOut_is_valid()
        {
            var transaction = new Transaction(_journal, TransactionDirection.Out, null, 123.45M);
            var vm = new TransactionViewModel(transaction, _mockAccountRepository);

            var white = new SolidColorBrush(Colors.White);
            Assert.AreEqual(white.ToString(), vm.AmountOutBackgroundColour.ToString());
            Assert.AreEqual(white.ToString(), vm.AmountInBackgroundColour.ToString());
        }
开发者ID:mattwatson,项目名称:Akcounts,代码行数:9,代码来源:TransactionViewModel_spec.cs

示例7: AmountInBackgroundColour_is_pink_when_AmountIn_is_invalid

        public void AmountInBackgroundColour_is_pink_when_AmountIn_is_invalid()
        {
            var transaction = new Transaction(_journal, TransactionDirection.In, _account);
            var vm = new TransactionViewModel(transaction, _mockAccountRepository);

            var white = new SolidColorBrush(Colors.White);
            var pink = new SolidColorBrush(Colors.Pink);
            Assert.AreEqual(pink.ToString(), vm.AmountInBackgroundColour.ToString());
            Assert.AreEqual(white.ToString(), vm.AmountOutBackgroundColour.ToString());
        }
开发者ID:mattwatson,项目名称:Akcounts,代码行数:10,代码来源:TransactionViewModel_spec.cs

示例8: PickerOnSelectedColorChanged

 /// <summary>
 /// Raise ColorChanged event when a new color is chosen using the picker
 /// </summary>
 private void PickerOnSelectedColorChanged(object sender, EventArgs<Color> eventArgs)
 {
     if (eventArgs != null) {
         var brush = new SolidColorBrush(eventArgs.Value);
         var hexColor = brush.ToString();
         ColorChanged?.Invoke(this, hexColor);
     }
 }
开发者ID:jameshy,项目名称:else,代码行数:11,代码来源:ColorPickerWindow.xaml.cs


注:本文中的System.Windows.Media.SolidColorBrush.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。