indexer

public string this[string Day]
    {
        get
        {
        string TodayWeather = null;
        //switch的标准写法
        switch (Day)
        {
            case "Sunday":
            {
                TodayWeather = "Today is cloudy!";
                break;
            }
            case "Friday":

      .....

原文地址:https://www.cnblogs.com/qinghao/p/1514428.html