本文整理汇总了C#中System.Drawing.Icon.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Icon.ToString方法的具体用法?C# Icon.ToString怎么用?C# Icon.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.Icon
的用法示例。
在下文中一共展示了Icon.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterStatusIcon
private void RegisterStatusIcon(Icon icon)
{
if (icon != Icon.None)
{
this.ResourceManager.RegisterClientStyleBlock(icon.ToString() + "-sbar", this.GetIconClass(icon));
}
}
示例2: SetUp
public void SetUp ()
{
icon = new Icon (TestBitmap.getInFile ("bitmaps/VisualPng.ico"));
iconStr = icon.ToString ();
icoConv = new IconConverter();
icoConvFrmTD = (IconConverter) TypeDescriptor.GetConverter (icon);
Stream stream = new FileStream (TestBitmap.getInFile ("bitmaps/VisualPng1.ico"), FileMode.Open);
int length = (int) stream.Length;
iconBytes = new byte [length];
try {
if (stream.Read (iconBytes, 0, length) != length)
Assert.Fail ("SU#1: Read Failure");
} catch (Exception e) {
Assert.Fail ("SU#2 Exception thrown while reading. Exception is: "+e.Message);
} finally {
stream.Close ();
}
stream.Close ();
}
示例3: GetIconClassName
public static string GetIconClassName(Icon icon)
{
return (icon != Icon.None) ? string.Format("icon-{0}-sbar", icon.ToString().ToLowerInvariant()) : "";
}
示例4: SetIconClass
/// <summary>
/// Sets the CSS class that provides a background image to use as the button's icon. This method also changes the value of the iconCls config internally.
/// </summary>
protected virtual void SetIconClass(Icon icon)
{
if (this.Icon != Icon.None)
{
this.SetIconClass("#" + icon.ToString());
}
else
{
this.SetIconClass("");
}
}
示例5: SetIconCls
/// <summary>
/// Sets the CSS class that provides a background image to use as the button's icon. This method also changes the value of the iconCls config internally.
/// </summary>
/// <param name="icon">New icon</param>
protected virtual void SetIconCls(Icon icon)
{
this.SetIconCls(this.Icon != Icon.None ? "#" + icon.ToString() : "");
}