@@ -21,13 +21,17 @@ public IndenterSettingsViewModel(Configuration config)
21
21
_endOfLineCommentStyle = config . UserSettings . IndenterSettings . EndOfLineCommentStyle ;
22
22
_forceCompilerDirectivesInColumn1 = config . UserSettings . IndenterSettings . ForceCompilerDirectivesInColumn1 ;
23
23
_forceDebugStatementsInColumn1 = config . UserSettings . IndenterSettings . ForceDebugStatementsInColumn1 ;
24
+ _forceDebugPrintInColumn1 = config . UserSettings . IndenterSettings . ForceDebugPrintInColumn1 ;
25
+ _forceDebugAssertInColumn1 = config . UserSettings . IndenterSettings . ForceDebugAssertInColumn1 ;
26
+ _forceStopInColumn1 = config . UserSettings . IndenterSettings . ForceStopInColumn1 ;
24
27
_ignoreOperatorsInContinuations = config . UserSettings . IndenterSettings . IgnoreOperatorsInContinuations ;
25
28
_indentCase = config . UserSettings . IndenterSettings . IndentCase ;
26
29
_indentCompilerDirectives = config . UserSettings . IndenterSettings . IndentCompilerDirectives ;
27
30
_indentEnumTypeAsProcedure = config . UserSettings . IndenterSettings . IndentEnumTypeAsProcedure ;
28
31
_indentEntireProcedureBody = config . UserSettings . IndenterSettings . IndentEntireProcedureBody ;
29
32
_indentFirstCommentBlock = config . UserSettings . IndenterSettings . IndentFirstCommentBlock ;
30
33
_indentFirstDeclarationBlock = config . UserSettings . IndenterSettings . IndentFirstDeclarationBlock ;
34
+ _ignoreEmptyLinesInFirstBlocks = config . UserSettings . IndenterSettings . IgnoreEmptyLinesInFirstBlocks ;
31
35
_indentSpaces = config . UserSettings . IndenterSettings . IndentSpaces ;
32
36
_spaceProcedures = config . UserSettings . IndenterSettings . VerticallySpaceProcedures ;
33
37
_procedureSpacing = config . UserSettings . IndenterSettings . LinesBetweenProcedures ;
@@ -169,11 +173,69 @@ public bool ForceDebugStatementsInColumn1
169
173
{
170
174
if ( _forceDebugStatementsInColumn1 != value )
171
175
{
172
- _forceDebugStatementsInColumn1 = value ; OnPropertyChanged ( ) ;
176
+ _forceDebugStatementsInColumn1 = value ;
177
+ ForceDebugPrintInColumn1 = _forceDebugStatementsInColumn1 ;
178
+ ForceDebugAssertInColumn1 = _forceDebugStatementsInColumn1 ;
179
+ ForceStopInColumn1 = _forceDebugStatementsInColumn1 ;
180
+ OnPropertyChanged ( ) ;
181
+ }
182
+ }
183
+ }
184
+
185
+ private bool _forceDebugPrintInColumn1 ;
186
+ public bool ForceDebugPrintInColumn1
187
+ {
188
+ get => _forceDebugPrintInColumn1 ;
189
+ set
190
+ {
191
+ if ( _forceDebugPrintInColumn1 != value )
192
+ {
193
+ _forceDebugPrintInColumn1 = value ;
194
+ if ( ! _forceDebugPrintInColumn1 && ! _forceDebugAssertInColumn1 && ! _forceStopInColumn1 )
195
+ {
196
+ ForceDebugStatementsInColumn1 = false ;
197
+ }
198
+ OnPropertyChanged ( ) ;
199
+ }
200
+ }
201
+ }
202
+
203
+ private bool _forceDebugAssertInColumn1 ;
204
+ public bool ForceDebugAssertInColumn1
205
+ {
206
+ get => _forceDebugAssertInColumn1 ;
207
+ set
208
+ {
209
+ if ( _forceDebugAssertInColumn1 != value )
210
+ {
211
+ _forceDebugAssertInColumn1 = value ;
212
+ if ( ! _forceDebugPrintInColumn1 && ! _forceDebugAssertInColumn1 && ! _forceStopInColumn1 )
213
+ {
214
+ ForceDebugStatementsInColumn1 = false ;
215
+ }
216
+ OnPropertyChanged ( ) ;
173
217
}
174
218
}
175
219
}
176
220
221
+ private bool _forceStopInColumn1 ;
222
+ public bool ForceStopInColumn1
223
+ {
224
+ get => _forceStopInColumn1 ;
225
+ set
226
+ {
227
+ if ( _forceStopInColumn1 != value )
228
+ {
229
+ _forceStopInColumn1 = value ;
230
+ if ( ! _forceDebugPrintInColumn1 && ! _forceDebugAssertInColumn1 && ! _forceStopInColumn1 )
231
+ {
232
+ ForceDebugStatementsInColumn1 = false ;
233
+ }
234
+ OnPropertyChanged ( ) ;
235
+ }
236
+ }
237
+ }
238
+
177
239
private bool _ignoreOperatorsInContinuations ;
178
240
public bool IgnoreOperatorsInContinuations
179
241
{
@@ -258,6 +320,20 @@ public bool IndentFirstDeclarationBlock
258
320
}
259
321
}
260
322
323
+ private bool _ignoreEmptyLinesInFirstBlocks ;
324
+ public bool IgnoreEmptyLinesInFirstBlocks
325
+ {
326
+ get => _ignoreEmptyLinesInFirstBlocks ;
327
+ set
328
+ {
329
+ if ( _ignoreEmptyLinesInFirstBlocks != value )
330
+ {
331
+ _ignoreEmptyLinesInFirstBlocks = value ;
332
+ OnPropertyChanged ( ) ;
333
+ }
334
+ }
335
+ }
336
+
261
337
private int _indentSpaces ;
262
338
public int IndentSpaces
263
339
{
@@ -300,7 +376,7 @@ public int LinesBetweenProcedures
300
376
}
301
377
}
302
378
303
- public string PreviewSampleCode
379
+ public string PreviewSampleCode
304
380
{
305
381
get
306
382
{
@@ -314,7 +390,7 @@ public string PreviewSampleCode
314
390
315
391
private IIndenterSettings GetCurrentSettings ( )
316
392
{
317
- return new SmartIndenter . IndenterSettings
393
+ return new SmartIndenter . IndenterSettings ( false )
318
394
{
319
395
AlignCommentsWithCode = AlignCommentsWithCode ,
320
396
AlignContinuations = AlignContinuations ,
@@ -324,13 +400,17 @@ private IIndenterSettings GetCurrentSettings()
324
400
EndOfLineCommentStyle = EndOfLineCommentStyle ,
325
401
ForceCompilerDirectivesInColumn1 = ForceCompilerDirectivesInColumn1 ,
326
402
ForceDebugStatementsInColumn1 = ForceDebugStatementsInColumn1 ,
403
+ ForceDebugPrintInColumn1 = ForceDebugPrintInColumn1 ,
404
+ ForceDebugAssertInColumn1 = ForceDebugAssertInColumn1 ,
405
+ ForceStopInColumn1 = ForceStopInColumn1 ,
327
406
IgnoreOperatorsInContinuations = IgnoreOperatorsInContinuations ,
328
407
IndentCase = IndentCase ,
329
408
IndentCompilerDirectives = IndentCompilerDirectives ,
330
409
IndentEnumTypeAsProcedure = IndentEnumTypeAsProcedure ,
331
410
IndentEntireProcedureBody = IndentEntireProcedureBody ,
332
411
IndentFirstCommentBlock = IndentFirstCommentBlock ,
333
412
IndentFirstDeclarationBlock = IndentFirstDeclarationBlock ,
413
+ IgnoreEmptyLinesInFirstBlocks = IgnoreEmptyLinesInFirstBlocks ,
334
414
IndentSpaces = IndentSpaces ,
335
415
VerticallySpaceProcedures = VerticallySpaceProcedures ,
336
416
LinesBetweenProcedures = LinesBetweenProcedures
@@ -349,13 +429,17 @@ public void UpdateConfig(Configuration config)
349
429
config . UserSettings . IndenterSettings . EndOfLineCommentStyle = EndOfLineCommentStyle ;
350
430
config . UserSettings . IndenterSettings . ForceCompilerDirectivesInColumn1 = ForceCompilerDirectivesInColumn1 ;
351
431
config . UserSettings . IndenterSettings . ForceDebugStatementsInColumn1 = ForceDebugStatementsInColumn1 ;
432
+ config . UserSettings . IndenterSettings . ForceDebugPrintInColumn1 = ForceDebugPrintInColumn1 ;
433
+ config . UserSettings . IndenterSettings . ForceDebugAssertInColumn1 = ForceDebugAssertInColumn1 ;
434
+ config . UserSettings . IndenterSettings . ForceStopInColumn1 = ForceStopInColumn1 ;
352
435
config . UserSettings . IndenterSettings . IgnoreOperatorsInContinuations = IgnoreOperatorsInContinuations ;
353
436
config . UserSettings . IndenterSettings . IndentCase = IndentCase ;
354
437
config . UserSettings . IndenterSettings . IndentEnumTypeAsProcedure = IndentEnumTypeAsProcedure ;
355
438
config . UserSettings . IndenterSettings . IndentCompilerDirectives = IndentCompilerDirectives ;
356
439
config . UserSettings . IndenterSettings . IndentEntireProcedureBody = IndentEntireProcedureBody ;
357
- config . UserSettings . IndenterSettings . IndentFirstCommentBlock = IndentFirstCommentBlock ;
440
+ config . UserSettings . IndenterSettings . IndentFirstCommentBlock = IndentFirstCommentBlock ;
358
441
config . UserSettings . IndenterSettings . IndentFirstDeclarationBlock = IndentFirstDeclarationBlock ;
442
+ config . UserSettings . IndenterSettings . IgnoreEmptyLinesInFirstBlocks = IgnoreEmptyLinesInFirstBlocks ;
359
443
config . UserSettings . IndenterSettings . IndentSpaces = IndentSpaces ;
360
444
config . UserSettings . IndenterSettings . VerticallySpaceProcedures = VerticallySpaceProcedures ;
361
445
config . UserSettings . IndenterSettings . LinesBetweenProcedures = LinesBetweenProcedures ;
@@ -376,13 +460,17 @@ private void TransferSettingsToView(IIndenterSettings toLoad)
376
460
EndOfLineCommentStyle = toLoad . EndOfLineCommentStyle ;
377
461
ForceCompilerDirectivesInColumn1 = toLoad . ForceCompilerDirectivesInColumn1 ;
378
462
ForceDebugStatementsInColumn1 = toLoad . ForceDebugStatementsInColumn1 ;
463
+ ForceDebugPrintInColumn1 = toLoad . ForceDebugPrintInColumn1 ;
464
+ ForceDebugAssertInColumn1 = toLoad . ForceDebugAssertInColumn1 ;
465
+ ForceStopInColumn1 = toLoad . ForceStopInColumn1 ;
379
466
IgnoreOperatorsInContinuations = toLoad . IgnoreOperatorsInContinuations ;
380
467
IndentCase = toLoad . IndentCase ;
381
468
IndentEnumTypeAsProcedure = toLoad . IndentEnumTypeAsProcedure ;
382
469
IndentCompilerDirectives = toLoad . IndentCompilerDirectives ;
383
470
IndentEntireProcedureBody = toLoad . IndentEntireProcedureBody ;
384
471
IndentFirstCommentBlock = toLoad . IndentFirstCommentBlock ;
385
472
IndentFirstDeclarationBlock = toLoad . IndentFirstDeclarationBlock ;
473
+ IgnoreEmptyLinesInFirstBlocks = toLoad . IgnoreEmptyLinesInFirstBlocks ;
386
474
IndentSpaces = toLoad . IndentSpaces ;
387
475
VerticallySpaceProcedures = toLoad . VerticallySpaceProcedures ;
388
476
LinesBetweenProcedures = toLoad . LinesBetweenProcedures ;
@@ -399,7 +487,7 @@ private void ImportSettings()
399
487
dialog . ShowDialog ( ) ;
400
488
if ( string . IsNullOrEmpty ( dialog . FileName ) ) return ;
401
489
var service = new XmlPersistanceService < SmartIndenter . IndenterSettings > { FilePath = dialog . FileName } ;
402
- var loaded = service . Load ( new SmartIndenter . IndenterSettings ( ) ) ;
490
+ var loaded = service . Load ( new SmartIndenter . IndenterSettings ( false ) ) ;
403
491
TransferSettingsToView ( loaded ) ;
404
492
}
405
493
}
0 commit comments