@@ -31,7 +31,7 @@ public class LongTermRetentionPolicy : RetentionPolicyBase
31
31
public bool IsMonthlyScheduleEnabled { get ; set ; }
32
32
public bool IsYearlyScheduleEnabled { get ; set ; }
33
33
public DailyRetentionSchedule DailySchedule { get ; set ; }
34
- public WeeklyRetentionSchedule WeeklySchedule { get ; set ; }
34
+ public WeeklyRetentionSchedule WeeklySchedule { get ; set ; }
35
35
public MonthlyRetentionSchedule MonthlySchedule { get ; set ; }
36
36
public YearlyRetentionSchedule YearlySchedule { get ; set ; }
37
37
@@ -98,8 +98,8 @@ public override void Validate()
98
98
{
99
99
YearlySchedule . Validate ( ) ;
100
100
}
101
- }
102
- }
101
+ }
102
+ }
103
103
104
104
public override string ToString ( )
105
105
{
@@ -114,7 +114,7 @@ public override string ToString()
114
114
YearlySchedule == null ? "NULL" : YearlySchedule . ToString ( ) ) ;
115
115
}
116
116
}
117
-
117
+
118
118
/// <summary>
119
119
/// Base class for retention schedule.
120
120
/// </summary>
@@ -127,15 +127,15 @@ public virtual void Validate()
127
127
if ( RetentionTimes == null || RetentionTimes . Count == 0 || RetentionTimes . Count != 1 )
128
128
{
129
129
throw new ArgumentException ( Resources . InvalidRetentionTimesInPolicyException ) ;
130
- }
131
- }
130
+ }
131
+ }
132
132
133
133
public override string ToString ( )
134
134
{
135
- return string . Format ( "RetentionTimes: {0}" , TraceUtils . GetString ( RetentionTimes ) ) ;
135
+ return string . Format ( "RetentionTimes: {0}" , TraceUtils . GetString ( RetentionTimes ) ) ;
136
136
}
137
137
}
138
-
138
+
139
139
/// <summary>
140
140
/// Daily rentention schedule.
141
141
/// </summary>
@@ -149,18 +149,17 @@ public override void Validate()
149
149
if ( DurationCountInDays <= 0 || DurationCountInDays > PolicyConstants . MaxAllowedRetentionDurationCount )
150
150
{
151
151
throw new ArgumentException ( Resources . RetentionDurationCountInvalidException ) ;
152
- }
152
+ }
153
153
154
154
base . Validate ( ) ;
155
155
}
156
-
156
+
157
157
public override string ToString ( )
158
158
{
159
- return string . Format ( "DurationCountInDays: {0}, {1}" ,
160
- DurationCountInDays , base . ToString ( ) ) ;
159
+ return string . Format ( "DurationCountInDays: {0}, {1}" , DurationCountInDays , base . ToString ( ) ) ;
161
160
}
162
161
}
163
-
162
+
164
163
/// <summary>
165
164
/// Weekly rentention schedule.
166
165
/// </summary>
@@ -183,16 +182,15 @@ public override void Validate()
183
182
}
184
183
185
184
base . Validate ( ) ;
186
- }
185
+ }
187
186
188
187
public override string ToString ( )
189
188
{
190
- return string . Format ( "DaysOfTheWeek: {0}, {1}" ,
191
- TraceUtils . GetString ( DaysOfTheWeek ) ,
192
- base . ToString ( ) ) ;
189
+ return string . Format ( "DurationCountInWeeks: {0}, DaysOfTheWeek: {1}, {2}" ,
190
+ DurationCountInWeeks , TraceUtils . GetString ( DaysOfTheWeek ) , base . ToString ( ) ) ;
193
191
}
194
192
}
195
-
193
+
196
194
/// <summary>
197
195
/// Monthly rentention schedule.
198
196
/// </summary>
@@ -208,7 +206,7 @@ public class MonthlyRetentionSchedule : RetentionScheduleBase
208
206
209
207
public MonthlyRetentionSchedule ( )
210
208
: base ( )
211
- {
209
+ {
212
210
}
213
211
214
212
public override void Validate ( )
@@ -219,7 +217,7 @@ public override void Validate()
219
217
{
220
218
throw new ArgumentException ( Resources . RetentionDurationCountInvalidException ) ;
221
219
}
222
-
220
+
223
221
if ( RetentionScheduleFormatType == RetentionScheduleFormat . Daily )
224
222
{
225
223
if ( RetentionScheduleDaily == null )
@@ -234,23 +232,24 @@ public override void Validate()
234
232
{
235
233
if ( RetentionScheduleWeekly == null )
236
234
{
237
- throw new ArgumentException ( Resources . MonthlyYearlyRetentionWeeklySchedulePolicyNULLException ) ;
235
+ throw new ArgumentException ( Resources . MonthlyYearlyRetentionWeeklySchedulePolicyNULLException ) ;
238
236
}
239
237
240
238
RetentionScheduleWeekly . Validate ( ) ;
241
239
}
242
- }
240
+ }
243
241
244
242
public override string ToString ( )
245
243
{
246
- return string . Format ( "RetentionScheduleType:{0}, {1}, RetentionScheduleDaily:{2}," +
247
- "RetentionScheduleWeekly:{3}, {4}" , RetentionScheduleFormatType , base . ToString ( ) ,
244
+ return string . Format ( "DurationCountInMonths:{0}, RetentionScheduleType:{1}, {2}, RetentionScheduleDaily:{3}," +
245
+ "RetentionScheduleWeekly:{4}, {5}" ,
246
+ DurationCountInMonths , RetentionScheduleFormatType , base . ToString ( ) ,
248
247
RetentionScheduleDaily == null ? "NULL" : RetentionScheduleDaily . ToString ( ) ,
249
248
RetentionScheduleWeekly == null ? "NULL" : RetentionScheduleWeekly . ToString ( ) ,
250
249
base . ToString ( ) ) ;
251
250
}
252
251
}
253
-
252
+
254
253
/// <summary>
255
254
/// Yearly rentention schedule.
256
255
/// </summary>
@@ -261,13 +260,13 @@ public class YearlyRetentionSchedule : RetentionScheduleBase
261
260
262
261
public List < Month > MonthsOfYear { get ; set ; }
263
262
public DailyRetentionFormat RetentionScheduleDaily { get ; set ; }
264
-
263
+
265
264
public WeeklyRetentionFormat RetentionScheduleWeekly { get ; set ; }
266
265
267
266
public YearlyRetentionSchedule ( )
268
267
: base ( )
269
268
{
270
-
269
+
271
270
}
272
271
273
272
public override void Validate ( )
@@ -278,12 +277,12 @@ public override void Validate()
278
277
{
279
278
throw new ArgumentException ( Resources . RetentionDurationCountInvalidException ) ;
280
279
}
281
-
280
+
282
281
if ( MonthsOfYear == null || MonthsOfYear . Count == 0 || MonthsOfYear . Count != MonthsOfYear . Distinct ( ) . Count ( ) )
283
282
{
284
283
throw new ArgumentException ( Resources . YearlyScheduleMonthsOfYearException ) ;
285
284
}
286
-
285
+
287
286
if ( RetentionScheduleFormatType == RetentionScheduleFormat . Daily )
288
287
{
289
288
if ( RetentionScheduleDaily == null )
@@ -303,20 +302,19 @@ public override void Validate()
303
302
304
303
RetentionScheduleWeekly . Validate ( ) ;
305
304
}
306
- }
305
+ }
307
306
308
307
public override string ToString ( )
309
308
{
310
- return string . Format ( "RetentionScheduleType:{0}, {1}, RetentionScheduleDaily:{2}," +
311
- "RetentionScheduleWeekly:{3}, MonthsOfYear: {4}, {5}" ,
312
- RetentionScheduleFormatType . ToString ( ) ,
313
- base . ToString ( ) ,
309
+ return string . Format ( "DurationCountInYears:{0}, RetentionScheduleType:{1}, {2}, RetentionScheduleDaily:{3}," +
310
+ "RetentionScheduleWeekly:{4}, MonthsOfYear: {5}, {6}" ,
311
+ DurationCountInYears , RetentionScheduleFormatType . ToString ( ) , base . ToString ( ) ,
314
312
RetentionScheduleDaily == null ? "NULL" : RetentionScheduleDaily . ToString ( ) ,
315
313
RetentionScheduleWeekly == null ? "NULL" : RetentionScheduleWeekly . ToString ( ) ,
316
314
TraceUtils . GetString < Month > ( MonthsOfYear ) , base . ToString ( ) ) ;
317
315
}
318
316
}
319
-
317
+
320
318
/// <summary>
321
319
/// Daily rentention format.
322
320
/// </summary>
@@ -343,13 +341,13 @@ public void Validate()
343
341
foreach ( Day day in DaysOfTheMonth )
344
342
{
345
343
day . Validate ( ) ;
346
- if ( day . IsLast )
344
+ if ( day . IsLast )
347
345
{
348
346
countOfIsLast ++ ;
349
347
}
350
348
}
351
349
352
- if ( countOfIsLast > 1 )
350
+ if ( countOfIsLast > 1 )
353
351
{
354
352
throw new ArgumentException ( Resources . InvalidDayInDaysOfMonthOfMonthlyYearlyRetentionPolicyException ) ;
355
353
}
@@ -360,7 +358,7 @@ public override string ToString()
360
358
return string . Format ( "DaysOfTheMonth:{0}" , TraceUtils . GetString ( DaysOfTheMonth ) ) ;
361
359
}
362
360
}
363
-
361
+
364
362
/// <summary>
365
363
/// Weekly rentention format.
366
364
/// </summary>
@@ -376,13 +374,13 @@ public void Validate()
376
374
DaysOfTheWeek . Count != DaysOfTheWeek . Distinct ( ) . Count ( ) )
377
375
{
378
376
throw new ArgumentException ( Resources . InvalidDaysOfWeekInMonthlyYearlyRetentionPolicyException ) ;
379
- }
377
+ }
380
378
381
379
if ( WeeksOfTheMonth == null || WeeksOfTheMonth . Count == 0 ||
382
380
WeeksOfTheMonth . Count != WeeksOfTheMonth . Distinct ( ) . Count ( ) )
383
381
{
384
382
throw new ArgumentException ( Resources . InvalidWeeksOfMonthInMonthlyYearlyRetentionPolicyException ) ;
385
- }
383
+ }
386
384
}
387
385
388
386
public override string ToString ( )
@@ -419,5 +417,5 @@ public override string ToString()
419
417
{
420
418
return string . Format ( "Date:{0}, IsLast:{1}" , Date , IsLast ) ;
421
419
}
422
- }
420
+ }
423
421
}
0 commit comments