@@ -62,9 +62,9 @@ public static Model.ModelChanges GetModelChanges(TabularModel model, Cancellatio
6262 return modelChanges ;
6363 }
6464
65- public void ApplyTemplates ( TabularModel model , CancellationToken ? cancellationToken )
65+ public void ApplyTemplates ( TabularModel model , CancellationToken cancellationToken = default )
6666 {
67- ( string className , Action < ITemplates . TemplateEntry , CancellationToken ? > action ) [ ] classes = new ( string , Action < ITemplates . TemplateEntry , CancellationToken ? > ) [ ]
67+ ( string className , Action < ITemplates . TemplateEntry , CancellationToken > action ) [ ] classes = new ( string , Action < ITemplates . TemplateEntry , CancellationToken > ) [ ]
6868 {
6969 ( nameof ( HolidaysDefinitionTable ) , ApplyHolidaysDefinitionTable ) ,
7070 ( nameof ( HolidaysTable ) , ApplyHolidaysTable ) ,
@@ -76,7 +76,7 @@ public void ApplyTemplates(TabularModel model, CancellationToken? cancellationTo
7676 {
7777 Configuration . Templates . ToList ( ) . ForEach ( template =>
7878 {
79- cancellationToken ? . ThrowIfCancellationRequested ( ) ;
79+ cancellationToken . ThrowIfCancellationRequested ( ) ;
8080 var ( className , action ) = classes . First ( c => c . className == template . Class ) ;
8181 action ( template , cancellationToken ) ;
8282 } ) ;
@@ -108,7 +108,7 @@ void RemoveOrphanTranslations()
108108 }
109109 }
110110
111- void ApplyHolidaysDefinitionTable ( ITemplates . TemplateEntry templateEntry , CancellationToken ? cancellationToken )
111+ void ApplyHolidaysDefinitionTable ( ITemplates . TemplateEntry templateEntry , CancellationToken cancellationToken = default )
112112 {
113113 Table tableHolidaysDefinition = model . Tables . Find ( templateEntry . Table ) ;
114114 if ( ! templateEntry . IsEnabled )
@@ -134,10 +134,10 @@ void ApplyHolidaysDefinitionTable(ITemplates.TemplateEntry templateEntry, Cancel
134134 throw new InvalidConfigurationException ( $ "Undefined Template in class { templateEntry . Class } configuration") ;
135135 }
136136 template = new HolidaysDefinitionTable ( _package . ReadDefinition < HolidaysDefinitionTable . HolidaysDefinitions > ( templateEntry . Template ) ) ;
137- template . ApplyTemplate ( tableHolidaysDefinition , cancellationToken , templateEntry . IsHidden ) ;
137+ template . ApplyTemplate ( tableHolidaysDefinition , templateEntry . IsHidden , cancellationToken ) ;
138138 tableHolidaysDefinition . RequestRefresh ( RefreshType . Full ) ;
139139 }
140- void ApplyHolidaysTable ( ITemplates . TemplateEntry templateEntry , CancellationToken ? cancellationToken )
140+ void ApplyHolidaysTable ( ITemplates . TemplateEntry templateEntry , CancellationToken cancellationToken = default )
141141 {
142142 Table tableHolidays = model . Tables . Find ( templateEntry . Table ) ;
143143 if ( ! templateEntry . IsEnabled )
@@ -159,10 +159,10 @@ void ApplyHolidaysTable(ITemplates.TemplateEntry templateEntry, CancellationToke
159159 }
160160 CalculatedTableTemplateBase template ;
161161 template = new HolidaysTable ( Configuration ) ;
162- template . ApplyTemplate ( tableHolidays , cancellationToken , templateEntry . IsHidden ) ;
162+ template . ApplyTemplate ( tableHolidays , templateEntry . IsHidden , cancellationToken ) ;
163163 tableHolidays . RequestRefresh ( RefreshType . Full ) ;
164164 }
165- void ApplyCustomDateTable ( ITemplates . TemplateEntry templateEntry , CancellationToken ? cancellationToken )
165+ void ApplyCustomDateTable ( ITemplates . TemplateEntry templateEntry , CancellationToken cancellationToken = default )
166166 {
167167 if ( string . IsNullOrWhiteSpace ( templateEntry . Template ) )
168168 {
@@ -184,7 +184,7 @@ void ApplyCustomDateTable(ITemplates.TemplateEntry templateEntry, CancellationTo
184184 model ,
185185 hideTable : true ,
186186 isoFormat : Configuration . IsoFormat ,
187- cancellationToken ) ;
187+ cancellationToken : cancellationToken ) ;
188188 }
189189 bool translationsEnabled = ! string . IsNullOrWhiteSpace ( Configuration . IsoTranslation ) ;
190190 ReferenceCalculatedTable visibleDateTemplate = CreateDateTable (
@@ -193,29 +193,29 @@ void ApplyCustomDateTable(ITemplates.TemplateEntry templateEntry, CancellationTo
193193 model ,
194194 hideTable : templateEntry . IsHidden ,
195195 isoFormat : Configuration . IsoFormat ,
196- cancellationToken ,
197196 referenceTable : templateEntry . ReferenceTable ,
198- applyTranslations : translationsEnabled ) ;
197+ applyTranslations : translationsEnabled ,
198+ cancellationToken ) ;
199199
200200 }
201- void ApplyMeasuresTemplate ( ITemplates . TemplateEntry templateEntry , CancellationToken ? cancellationToken )
201+ void ApplyMeasuresTemplate ( ITemplates . TemplateEntry templateEntry , CancellationToken cancellationToken = default )
202202 {
203203 if ( string . IsNullOrWhiteSpace ( templateEntry . Template ) )
204204 {
205205 throw new InvalidConfigurationException ( $ "Undefined Template in class { templateEntry . Class } configuration") ;
206206 }
207207 var measuresTemplateDefinition = _package . ReadDefinition < MeasuresTemplateDefinition > ( templateEntry . Template ) ;
208208 var template = new MeasuresTemplate ( Configuration , measuresTemplateDefinition , templateEntry . Properties ) ;
209- template . ApplyTemplate ( model , templateEntry . IsEnabled , cancellationToken ) ;
209+ template . ApplyTemplate ( model , isEnabled : templateEntry . IsEnabled , cancellationToken : cancellationToken ) ;
210210 }
211211 }
212212
213- private Translations . Definitions ReadTranslations ( CancellationToken ? cancellationToken )
213+ private Translations . Definitions ReadTranslations ( CancellationToken cancellationToken = default )
214214 {
215215 Translations . Definitions translations = new ( ) ;
216216 foreach ( var localizationFile in Configuration . LocalizationFiles ! )
217217 {
218- cancellationToken ? . ThrowIfCancellationRequested ( ) ;
218+ cancellationToken . ThrowIfCancellationRequested ( ) ;
219219 Translations . Definitions definitions = _package . ReadDefinition < Translations . Definitions > ( localizationFile ) ;
220220 translations . Translations = translations . Translations . Union ( definitions . Translations ) . ToArray ( ) ;
221221 }
@@ -230,9 +230,9 @@ private ReferenceCalculatedTable CreateDateTable(
230230 TabularModel model ,
231231 bool hideTable ,
232232 string ? isoFormat ,
233- CancellationToken ? cancellationToken ,
234233 string ? referenceTable = null ,
235- bool applyTranslations = false )
234+ bool applyTranslations = false ,
235+ CancellationToken cancellationToken = default )
236236 {
237237 Table tableDate = model . Tables . Find ( dateTableName ) ;
238238 if ( tableDate == null )
@@ -256,7 +256,7 @@ private ReferenceCalculatedTable CreateDateTable(
256256 IsoFormat = isoFormat
257257 } ;
258258
259- template . ApplyTemplate ( tableDate , cancellationToken , hideTable ) ;
259+ template . ApplyTemplate ( tableDate , hideTable , cancellationToken ) ;
260260
261261 tableDate . RequestRefresh ( RefreshType . Full ) ;
262262
0 commit comments