프로그래밍/C#2019. 2. 15. 14:31

public static class ClubTypeToStringKey

{

    private static Dictionary<CLUB_TYPE, StringTableKeys> typeTostringKey

        = new Dictionary<CLUB_TYPE, StringTableKeys>();


    public static StringTableKeys ToStringKey(this CLUB_TYPE type)

    {

        if(typeTostringKey.ContainsKey(type))

        {

            return typeTostringKey[type];

        }


        StringTableKeys result;

        if (Enum.TryParse(type.ToString(), out result))

        {

            typeTostringKey.Add(type, result);

        }


        return typeTostringKey[type];

    }

}

'프로그래밍 > C#' 카테고리의 다른 글

const , nonconst  (0) 2018.10.12
코드 교정?  (0) 2018.08.29
스트림이란??  (0) 2018.07.31
var  (0) 2018.04.11
캘린더  (0) 2018.03.28
Posted by JinFluenza