@@ -15,9 +15,10 @@ namespace Ical.Net.DataTypes
1515 public class RecurrencePattern : EncodableDataType
1616 {
1717 private int _interval = int . MinValue ;
18+ #pragma warning disable 0618
1819 private RecurrenceRestrictionType ? _restrictionType ;
1920 private RecurrenceEvaluationModeType ? _evaluationMode ;
20-
21+ #pragma warning restore 0618
2122 public FrequencyType Frequency { get ; set ; }
2223
2324 private DateTime _until = DateTime . MinValue ;
@@ -84,6 +85,7 @@ public int Interval
8485
8586 public DayOfWeek FirstDayOfWeek { get ; set ; } = DayOfWeek . Monday ;
8687
88+ #pragma warning disable 0618
8789 /// <summary>
8890 /// The type of restriction to apply to the evaluation of this recurrence pattern.
8991 /// Returns <see cref="RecurrenceRestrictionType.NoRestriction"/> if not set.
@@ -98,7 +100,7 @@ public RecurrenceRestrictionType RestrictionType
98100 {
99101 return _restrictionType . Value ;
100102 }
101- return RecurrenceRestrictionType . NoRestriction ;
103+ return Calendar ? . RecurrenceRestriction ?? RecurrenceRestrictionType . Default ;
102104 }
103105 set => _restrictionType = value ;
104106 }
@@ -117,6 +119,7 @@ public RecurrenceEvaluationModeType EvaluationMode
117119 }
118120 set => _evaluationMode = value ;
119121 }
122+ #pragma warning restore 0618
120123
121124 public RecurrencePattern ( )
122125 {
@@ -148,8 +151,10 @@ public override string ToString()
148151 }
149152
150153 protected bool Equals ( RecurrencePattern other ) => ( Interval == other . Interval )
154+ #pragma warning disable 0618
151155 && RestrictionType == other . RestrictionType
152156 && EvaluationMode == other . EvaluationMode
157+ #pragma warning restore 0618
153158 && Frequency == other . Frequency
154159 && Until . Equals ( other . Until )
155160 && Count == other . Count
@@ -176,8 +181,10 @@ public override int GetHashCode()
176181 unchecked
177182 {
178183 var hashCode = Interval . GetHashCode ( ) ;
184+ #pragma warning disable 0618
179185 hashCode = ( hashCode * 397 ) ^ RestrictionType . GetHashCode ( ) ;
180186 hashCode = ( hashCode * 397 ) ^ EvaluationMode . GetHashCode ( ) ;
187+ #pragma warning restore 0618
181188 hashCode = ( hashCode * 397 ) ^ ( int ) Frequency ;
182189 hashCode = ( hashCode * 397 ) ^ Until . GetHashCode ( ) ;
183190 hashCode = ( hashCode * 397 ) ^ Count ;
@@ -218,8 +225,10 @@ public override void CopyFrom(ICopyable obj)
218225 ByMonth = new List < int > ( r . ByMonth ) ;
219226 BySetPosition = new List < int > ( r . BySetPosition ) ;
220227 FirstDayOfWeek = r . FirstDayOfWeek ;
228+ #pragma warning disable 0618
221229 RestrictionType = r . RestrictionType ;
222230 EvaluationMode = r . EvaluationMode ;
231+ #pragma warning restore 0618
223232 }
224233
225234 private static bool CollectionEquals < T > ( IEnumerable < T > c1 , IEnumerable < T > c2 ) => c1 . SequenceEqual ( c2 ) ;
0 commit comments