本文整理汇总了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);
}
示例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());
}
示例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());
}
示例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;
}
示例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;
}
示例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());
}
示例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());
}
示例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);
}
}