@@ -10,16 +10,29 @@ Namespace CompuMaster.Calendar
1010 Implements IComparable
1111
1212 ''' <summary>
13- ''' Create a new instance of MonthRange with clones of first and last period (to behave more like value type instead of reference type)
13+ ''' Create a new instance of MonthRange with clones of first and last month (to behave more like value type instead of reference type)
1414 ''' </summary>
15- ''' <param name="firstPeriod"></param>
16- ''' <param name="lastPeriod"></param>
17- Public Sub New (firstPeriod As CompuMaster.Calendar.Month, lastPeriod As CompuMaster.Calendar.Month)
18- If firstPeriod Is Nothing Then Throw New ArgumentNullException( NameOf (firstPeriod))
19- If lastPeriod Is Nothing Then Throw New ArgumentNullException( NameOf (lastPeriod))
20- If firstPeriod > lastPeriod Then Throw New ArgumentException( "First period must be before last period" )
21- Me ._FirstMonth = firstPeriod.Clone
22- Me ._LastMonth = lastPeriod.Clone
15+ ''' <param name="firstMonth"></param>
16+ ''' <param name="lastMonth"></param>
17+ Public Sub New (firstMonth As CompuMaster.Calendar.Month, lastMonth As CompuMaster.Calendar.Month)
18+ If firstMonth Is Nothing Then Throw New ArgumentNullException( NameOf (firstMonth))
19+ If lastMonth Is Nothing Then Throw New ArgumentNullException( NameOf (lastMonth))
20+ Me ._FirstMonth = firstMonth.Clone
21+ Me ._LastMonth = lastMonth.Clone
22+ If Me ._FirstMonth > Me ._LastMonth Then Throw New ArgumentException( "First month must be before last month" )
23+ End Sub
24+
25+ ''' <summary>
26+ ''' Create a new instance of MonthRange with clones of first and last month (to behave more like value type instead of reference type)
27+ ''' </summary>
28+ ''' <param name="startYear"></param>
29+ ''' <param name="startMonth"></param>
30+ ''' <param name="endYear"></param>
31+ ''' <param name="endMonth"></param>
32+ Public Sub New (startYear As Integer , startMonth As Integer , endYear As Integer , endMonth As Integer )
33+ Me ._FirstMonth = New Month(startYear, startMonth)
34+ Me ._LastMonth = New Month(endYear, endMonth)
35+ If Me ._FirstMonth > Me ._LastMonth Then Throw New ArgumentException( "Start month must be before last month" )
2336 End Sub
2437
2538 Private _FirstMonth As CompuMaster.Calendar.Month
0 commit comments