📄 fontnamesconverter.cs
字号:
using System;
using System.Globalization;
using System.ComponentModel;
namespace System.Web.UI.WebControls
{
/// <summary>
/// Summary description for FontNamesConverter.
/// </summary>
public class FontNamesConverter : TypeConverter
{
public FontNamesConverter() : base()
{
}
public virtual bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
if (sourceType == typeof(String))
return true;
return false;
}
public virtual object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
string[] local0;
int local1;
char[] local2;
if (value as String != null)
{
if (((String) value).Length == 0)
return new String[0];
local2 = new Char[1];
local2[0] = (char)44;
local0 = ((String) value).Split(local2);
local1 = 0;
while (local1 < (int) local0.Length)
{
local0[local1] = local0[local1].Trim();
local1++;
}
return local0;
}
throw this.GetConvertFromException(value);
}
public virtual object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(String))
{
if (value == null)
return "";
return System.String.Join(",", (string[]) value);
}
throw this.GetConvertToException(value, destinationType);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -