using System;
using System.Collections.Generic;

namespace Stat.Items
{
    public class NetClrVersion
    {
        /// <summary>
        /// .net 版本
        /// </summary>
        /// <returns></returns>
        public static String[,] Get()
        {
            string[,] NetFW = new string[6, 2];

            NetFW[0, 0] = "0";
            NetFW[0, 1] = "未安装";

            NetFW[1, 0] = "1";
            NetFW[1, 1] = "1.1";

            NetFW[2, 0] = "2";
            NetFW[2, 1] = "2.0";

            NetFW[3, 0] = "3";
            NetFW[3, 1] = "3.0";

            NetFW[4, 0] = "4";
            NetFW[4, 1] = "3.5";

            NetFW[5, 0] = "5";
            NetFW[5, 1] = "4.0";

            return NetFW;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        public static List<Model.StatItem> Get(List<Model.StatItem> list)
        {
            foreach (Model.StatItem item in list)
            {
                item.Name = NumberToName(item.ID);
            }
            return list;
        }

        /// <summary>
        /// 根据 编号  获取名称
        /// </summary>
        /// <param name="Eno">编号</param>
        /// <returns>名称</returns>
        private static string NumberToName(int Eno)
        {
            string[,] arr = Get();
            string ss = "其他";
            for (int i = 0; i < arr.GetLength(0); i++)
            {
                if (arr[i, 0].ToString() == Eno.ToString())
                {
                    ss = arr[i, 1].ToString();
                }
            }
            return ss;
        }
    }
}
