?? conversionhelper.cs
字號(hào):
// *****************************************************************************
//
// (c) Crownwood Consulting Limited 2002
// All rights reserved. The software and associated documentation
// supplied hereunder are the proprietary information of Crownwood Consulting
// Limited, Haxey, North Lincolnshire, England and are supplied subject to
// licence terms.
//
// Magic Version 1.7 www.dotnetmagic.com
// *****************************************************************************
using System;
using System.Text;
using System.Drawing;
namespace Crownwood.Magic.Common
{
public class ConversionHelper
{
// Faster performance to cache the converters and type objects, rather
// than keep recreating them each time a conversion is required
protected static SizeConverter _sc = new SizeConverter();
protected static PointConverter _pc = new PointConverter();
protected static Type _stringType = Type.GetType("System.String");
public static string SizeToString(Size size)
{
return (string)_sc.ConvertTo(size, _stringType);
}
public static Size StringToSize(string str)
{
return (Size)_sc.ConvertFrom(str);
}
public static string PointToString(Point point)
{
return (string)_pc.ConvertTo(point, _stringType);
}
public static Point StringToPoint(string str)
{
return (Point)_pc.ConvertFrom(str);
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -