添加注释

This commit is contained in:
王超
2016-06-23 17:14:27 +08:00
parent 2982b8b5e2
commit 7e35d03e89
2 changed files with 10 additions and 8 deletions
+2 -2
View File
@@ -13,8 +13,8 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C34A14D3-E650-4046-BEC8-3F741AA4678B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C34A14D3-E650-4046-BEC8-3F741AA4678B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C34A14D3-E650-4046-BEC8-3F741AA4678B}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{C34A14D3-E650-4046-BEC8-3F741AA4678B}.Debug|Any CPU.Build.0 = Release|Any CPU
{C34A14D3-E650-4046-BEC8-3F741AA4678B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C34A14D3-E650-4046-BEC8-3F741AA4678B}.Release|Any CPU.Build.0 = Release|Any CPU
{9F95263C-4F7F-416B-A1B9-D3A0526E2638}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+8 -6
View File
@@ -7,19 +7,23 @@ using System.Text;
namespace OS.Common.Extention
{
/// <summary>
/// 枚举扩展方法类
/// </summary>
public static class EnumExtention
{
/// <summary>
/// 获取描述
/// </summary>
/// <param name="en"></param>
/// <param name="en">枚举对象</param>
/// <param name="isFlag">是否二进制取和</param>
/// <param name="operate">多个描述分隔符</param>
/// <returns></returns>
public static string GetDesp(this Enum en, bool isFlag = false, string operate = ",")
{
var values = en.GetType().ToEnumDirs();
int current = (int) Enum.Parse(en.GetType(), en.ToString());
if (isFlag)
{
StringBuilder strResult = new StringBuilder();
@@ -42,9 +46,7 @@ namespace OS.Common.Extention
KeyValuePair<string, string> keypair = values.FirstOrDefault(e => e.Key == current.ToString());
return keypair.Key == null ? "不存在的枚举值" : keypair.Value;
}
private static ConcurrentDictionary<string, Dictionary<string, string>> enumDirs
=new ConcurrentDictionary<string, Dictionary<string, string>>();