Date.this C# (CSharp) Method

this() public method

public this ( string str ) : int
str string
return int
    public int this[string str]
    {
        get
        {
            switch (str.ToLower())
            {
            case "year":
                return Year;
            case "month":
                return Month;
            case "day":
                return Day;
            default:
                throw new ArgumentOutOfRangeException("index = " + str);
            }
        }
        set
        {
            switch(str.ToLower())
            {
            case "year":
                Year = value;
                break;
            case "month":
                Month = value;
                break;
            case "day":
                Day = value;
                break;
            default:
                throw new ArgumentOutOfRangeException("index = " + str);
            }
        }
    }