// 从string 到Enum
public DownloadProxyUsage ProxyUsage
{
get
{
string proxyUsage =
ConfigurationManager.AppSettings[@"downloadProxyUsage"];
if ( string.IsNullOrEmpty( proxyUsage ) )
{
return DownloadProxyUsage.Default;
}
else
{
return (DownloadProxyUsage)Enum.Parse(
typeof( DownloadProxyUsage ),
proxyUsage,
true );
}
}
}
//从Enum到string
public new string ToString
{
get { return Enum.GetName(typeof(eCompress), eCompress.RAR); }
}