c#遍历更改字典

65 阅读1分钟
       for(int i = 0; i < mYValueMax.Count; i++)
        {
            if (mYValueMax.ElementAt(i).Key.Equals(yPattern))
            {
                int max = mYValueMax.ElementAt(i).Value;
                if(yValue >= max)
                {
                    mYValueMax[mYValueMax.ElementAt(i).Key] = yValue;
                }
                break;
            }
        }