本文整理匯總了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() : "");
}