Skip to content

Commit 341f78f

Browse files
update comments
1 parent 6abaa0d commit 341f78f

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

src/Microsoft.FeatureManagement/FeatureFilters/Recurrence/RecurrenceEvaluator.cs

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static class RecurrenceEvaluator
1616
/// <summary>
1717
/// Checks if a provided timestamp is within any recurring time window specified by the Recurrence section in the time window filter settings.
1818
/// If the time window filter has an invalid recurrence setting, an exception will be thrown.
19-
/// <param name="time">A timestamp.</param>
19+
/// <param name="time">A datetime.</param>
2020
/// <param name="settings">The settings of time window filter.</param>
2121
/// <returns>True if the timestamp is within any recurring time window, false otherwise.</returns>
2222
/// </summary>
@@ -42,8 +42,8 @@ public static bool IsMatch(DateTimeOffset time, TimeWindowFilterSettings setting
4242
}
4343

4444
/// <summary>
45-
/// Calculate the start time of the closest active time window.
46-
/// <param name="time">A timestamp.</param>
45+
/// Calculates the start time of the closest active time window.
46+
/// <param name="time">A datetime.</param>
4747
/// <param name="settings">The settings of time window filter.</param>
4848
/// <returns>The start time of the closest active time window or null if the recurrence range surpasses its end.</returns>
4949
/// </summary>
@@ -76,8 +76,8 @@ public static bool IsMatch(DateTimeOffset time, TimeWindowFilterSettings setting
7676
}
7777

7878
/// <summary>
79-
/// Calculate the closest previous recurrence occurrence (if any) before the provided timestamp and the next occurrence (if any) after the provided timestamp.
80-
/// <param name="time">A timestamp.</param>
79+
/// Calculates the closest previous recurrence occurrence (if any) before the given time and the next occurrence (if any) after it.
80+
/// <param name="time">A datetime.</param>
8181
/// <param name="settings">The settings of time window filter.</param>
8282
/// <param name="prevOccurrence">The closest previous occurrence. Note that prev occurrence can be null even if the time is past the start date, because the recurrence range may have surpassed its end.</param>
8383
/// <param name="nextOccurrence">The next occurrence. Note that next occurrence can be null even if the prev occurrence is not null, because the recurrence range may have reached its end.</param>
@@ -139,8 +139,10 @@ private static void CalculateSurroundingOccurrences(DateTimeOffset time, TimeWin
139139

140140

141141
/// <summary>
142-
/// Try to find the closest previous recurrence occurrence before the provided timestamp according to the recurrence pattern. The given time should be later than the recurrence start.
143-
/// <param name="time">A timestamp.</param>
142+
/// Finds the closest previous recurrence occurrence before the given time according to the recurrence pattern.
143+
/// The given time should be later than the recurrence start.
144+
/// A return value indicates whether any previous occurrence can be found.
145+
/// <param name="time">A datetime.</param>
144146
/// <param name="settings">The settings of time window filter.</param>
145147
/// <param name="previousOccurrence">The closest previous occurrence.</param>
146148
/// <param name="numberOfOccurrences">The number of occurrences between the time and the recurrence start.</param>
@@ -182,8 +184,9 @@ private static bool TryFindPreviousOccurrence(DateTimeOffset time, TimeWindowFil
182184
}
183185

184186
/// <summary>
185-
/// Find the closest previous recurrence occurrence before the provided timestamp according to the "Daily" recurrence pattern. The given time should be later than the recurrence start.
186-
/// <param name="time">A timestamp.</param>
187+
/// Finds the closest previous recurrence occurrence before the given time according to the "Daily" recurrence pattern.
188+
/// The given time should be later than the recurrence start.
189+
/// <param name="time">A datetime.</param>
187190
/// <param name="settings">The settings of time window filter.</param>
188191
/// <param name="previousOccurrence">The closest previous occurrence.</param>
189192
/// <param name="numberOfOccurrences">The number of occurrences between the time and the recurrence start.</param>
@@ -210,8 +213,9 @@ private static void FindDailyPreviousOccurrence(DateTimeOffset time, TimeWindowF
210213
}
211214

212215
/// <summary>
213-
/// Find the closest previous recurrence occurrence before the provided timestamp according to the "Weekly" recurrence pattern. The given time should be later than the recurrence start.
214-
/// <param name="time">A timestamp.</param>
216+
/// Finds the closest previous recurrence occurrence before the given time according to the "Weekly" recurrence pattern.
217+
/// The given time should be later than the recurrence start.
218+
/// <param name="time">A datetime.</param>
215219
/// <param name="settings">The settings of time window filter.</param>
216220
/// <param name="previousOccurrence">The closest previous occurrence.</param>
217221
/// <param name="numberOfOccurrences">The number of occurrences between the time and the recurrence start.</param>
@@ -304,7 +308,7 @@ private static void FindWeeklyPreviousOccurrence(DateTimeOffset time, TimeWindow
304308
}
305309

306310
/// <summary>
307-
/// Find the next recurrence occurrence after the provided previous occurrence according to the "Weekly" recurrence pattern.
311+
/// Finds the next recurrence occurrence after the provided previous occurrence according to the "Weekly" recurrence pattern.
308312
/// <param name="previousOccurrence">The previous occurrence.</param>
309313
/// <param name="settings">The settings of time window filter.</param>
310314
/// </summary>
@@ -327,7 +331,7 @@ private static DateTimeOffset CalculateWeeklyNextOccurrence(DateTimeOffset previ
327331
}
328332

329333
/// <summary>
330-
/// Calculate the offset in days between two given days of the week.
334+
/// Calculates the offset in days between two given days of the week.
331335
/// <param name="day1">A day of week.</param>
332336
/// <param name="day2">A day of week.</param>
333337
/// <returns>The number of days to be added to day2 to reach day1</returns>
@@ -339,7 +343,7 @@ private static int CalculateWeeklyDayOffset(DayOfWeek day1, DayOfWeek day2)
339343

340344

341345
/// <summary>
342-
/// Sort a collection of days of week based on their offsets from a specified first day of week.
346+
/// Sorts a collection of days of week based on their offsets from a specified first day of week.
343347
/// <param name="daysOfWeek">A collection of days of week.</param>
344348
/// <param name="firstDayOfWeek">The first day of week.</param>
345349
/// <returns>The sorted days of week.</returns>

src/Microsoft.FeatureManagement/FeatureFilters/Recurrence/RecurrenceValidator.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static class RecurrenceValidator
2121
const string TimeWindowDurationOutOfRange = "Time window duration cannot be longer than how frequently it occurs or be longer than 10 years.";
2222

2323
/// <summary>
24-
/// Perform validation of time window settings.
24+
/// Performs validation of time window settings.
2525
/// <param name="settings">The settings of time window filter.</param>
2626
/// <param name="paramName">The name of the invalid setting, if any.</param>
2727
/// <param name="reason">The reason that the setting is invalid.</param>
@@ -331,7 +331,7 @@ private static bool TryValidateNumberOfOccurrences(TimeWindowFilterSettings sett
331331
}
332332

333333
/// <summary>
334-
/// Check whether the duration is shorter than the minimum gap between recurrence of days of week.
334+
/// Checks whether the duration is shorter than the minimum gap between recurrence of days of week.
335335
/// </summary>
336336
/// <param name="duration">The time span of the duration.</param>
337337
/// <param name="interval">The recurrence interval.</param>
@@ -400,7 +400,7 @@ private static bool IsDurationCompliantWithDaysOfWeek(TimeSpan duration, int int
400400
}
401401

402402
/// <summary>
403-
/// Calculate the offset in days between two given days of the week.
403+
/// Calculates the offset in days between two given days of the week.
404404
/// <param name="day1">A day of week.</param>
405405
/// <param name="day2">A day of week.</param>
406406
/// <returns>The number of days to be added to day2 to reach day1</returns>
@@ -412,7 +412,7 @@ private static int CalculateWeeklyDayOffset(DayOfWeek day1, DayOfWeek day2)
412412

413413

414414
/// <summary>
415-
/// Sort a collection of days of week based on their offsets from a specified first day of week.
415+
/// Sorts a collection of days of week based on their offsets from a specified first day of week.
416416
/// <param name="daysOfWeek">A collection of days of week.</param>
417417
/// <param name="firstDayOfWeek">The first day of week.</param>
418418
/// <returns>The sorted days of week.</returns>

0 commit comments

Comments
 (0)