Пример #1
0
        private string GetNetworkNodeName(NetworkNodes value)
        {
            var memberInfo = value.GetType().GetMember(value.ToString());

            if (memberInfo.Length != 1)
            {
                return(null);
            }

            var displayAttribute = memberInfo[0].GetCustomAttributes(typeof(DisplayAttribute), false)
                                   as DisplayAttribute[];

            if (displayAttribute == null || displayAttribute.Length != 1)
            {
                return(null);
            }

            return(displayAttribute[0].Name);
        }