~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/nrefactory/ICSharpCode.NRefactory.CSharp/Formatter/CSharpFormattingOptions.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
ļ»æ// 
 
2
// CSharpFormattingOptions.cs
 
3
//  
 
4
// Author:
 
5
//       Mike KrĆ¼ger <mkrueger@novell.com>
 
6
//  
 
7
// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
 
8
// 
 
9
// Permission is hereby granted, free of charge, to any person obtaining a copy
 
10
// of this software and associated documentation files (the "Software"), to deal
 
11
// in the Software without restriction, including without limitation the rights
 
12
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 
13
// copies of the Software, and to permit persons to whom the Software is
 
14
// furnished to do so, subject to the following conditions:
 
15
// 
 
16
// The above copyright notice and this permission notice shall be included in
 
17
// all copies or substantial portions of the Software.
 
18
// 
 
19
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
20
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
21
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 
22
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
23
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 
24
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 
25
// THE SOFTWARE.
 
26
 
 
27
using System;
 
28
using System.Reflection;
 
29
using System.Linq;
 
30
 
 
31
namespace ICSharpCode.NRefactory.CSharp
 
32
{
 
33
        public enum BraceStyle
 
34
        {
 
35
                DoNotChange,
 
36
                EndOfLine,
 
37
                EndOfLineWithoutSpace,
 
38
                NextLine,
 
39
                NextLineShifted,
 
40
                NextLineShifted2,
 
41
                BannerStyle
 
42
        }
 
43
 
 
44
        public enum PropertyFormatting
 
45
        {
 
46
                AllowOneLine,
 
47
                ForceOneLine,
 
48
                ForceNewLine
 
49
        }
 
50
 
 
51
        public enum Wrapping {
 
52
                DoNotChange,
 
53
                DoNotWrap,
 
54
                WrapAlways,
 
55
                WrapIfTooLong
 
56
        }
 
57
 
 
58
        public enum NewLinePlacement {
 
59
                DoNotCare,
 
60
                NewLine,
 
61
                SameLine
 
62
        }
 
63
 
 
64
        public enum UsingPlacement {
 
65
                TopOfFile,
 
66
                InsideNamespace
 
67
        }
 
68
 
 
69
        public class CSharpFormattingOptions
 
70
        {
 
71
                public string Name {
 
72
                        get;
 
73
                        set;
 
74
                }
 
75
 
 
76
                public bool IsBuiltIn {
 
77
                        get;
 
78
                        set;
 
79
                }
 
80
 
 
81
                public CSharpFormattingOptions Clone ()
 
82
                {
 
83
                        return (CSharpFormattingOptions)MemberwiseClone ();
 
84
                }
 
85
 
 
86
                #region Indentation
 
87
                public bool IndentNamespaceBody { // tested
 
88
                        get;
 
89
                        set;
 
90
                }
 
91
 
 
92
                public bool IndentClassBody { // tested
 
93
                        get;
 
94
                        set;
 
95
                }
 
96
 
 
97
                public bool IndentInterfaceBody { // tested
 
98
                        get;
 
99
                        set;
 
100
                }
 
101
 
 
102
                public bool IndentStructBody { // tested
 
103
                        get;
 
104
                        set;
 
105
                }
 
106
 
 
107
                public bool IndentEnumBody { // tested
 
108
                        get;
 
109
                        set;
 
110
                }
 
111
 
 
112
                public bool IndentMethodBody { // tested
 
113
                        get;
 
114
                        set;
 
115
                }
 
116
 
 
117
                public bool IndentPropertyBody { // tested
 
118
                        get;
 
119
                        set;
 
120
                }
 
121
 
 
122
                public bool IndentEventBody { // tested
 
123
                        get;
 
124
                        set;
 
125
                }
 
126
 
 
127
                public bool IndentBlocks { // tested
 
128
                        get;
 
129
                        set;
 
130
                }
 
131
 
 
132
                public bool IndentSwitchBody { // tested
 
133
                        get;
 
134
                        set;
 
135
                }
 
136
 
 
137
                public bool IndentCaseBody { // tested
 
138
                        get;
 
139
                        set;
 
140
                }
 
141
 
 
142
                public bool IndentBreakStatements { // tested
 
143
                        get;
 
144
                        set;
 
145
                }
 
146
 
 
147
                public bool AlignEmbeddedUsingStatements { // tested
 
148
                        get;
 
149
                        set;
 
150
                }
 
151
 
 
152
                public bool AlignEmbeddedIfStatements { // tested
 
153
                        get;
 
154
                        set;
 
155
                }
 
156
 
 
157
                public PropertyFormatting PropertyFormatting { // tested
 
158
                        get;
 
159
                        set;
 
160
                }
 
161
 
 
162
                #endregion
 
163
                
 
164
                #region Braces
 
165
                public BraceStyle NamespaceBraceStyle { // tested
 
166
                        get;
 
167
                        set;
 
168
                }
 
169
 
 
170
                public BraceStyle ClassBraceStyle { // tested
 
171
                        get;
 
172
                        set;
 
173
                }
 
174
 
 
175
                public BraceStyle InterfaceBraceStyle { // tested
 
176
                        get;
 
177
                        set;
 
178
                }
 
179
 
 
180
                public BraceStyle StructBraceStyle { // tested
 
181
                        get;
 
182
                        set;
 
183
                }
 
184
 
 
185
                public BraceStyle EnumBraceStyle { // tested
 
186
                        get;
 
187
                        set;
 
188
                }
 
189
 
 
190
                public BraceStyle MethodBraceStyle { // tested
 
191
                        get;
 
192
                        set;
 
193
                }
 
194
 
 
195
                public BraceStyle AnonymousMethodBraceStyle {
 
196
                        get;
 
197
                        set;
 
198
                }
 
199
 
 
200
                public BraceStyle ConstructorBraceStyle {  // tested
 
201
                        get;
 
202
                        set;
 
203
                }
 
204
 
 
205
                public BraceStyle DestructorBraceStyle { // tested
 
206
                        get;
 
207
                        set;
 
208
                }
 
209
 
 
210
                public BraceStyle PropertyBraceStyle { // tested
 
211
                        get;
 
212
                        set;
 
213
                }
 
214
 
 
215
                public BraceStyle PropertyGetBraceStyle { // tested
 
216
                        get;
 
217
                        set;
 
218
                }
 
219
 
 
220
                public BraceStyle PropertySetBraceStyle { // tested
 
221
                        get;
 
222
                        set;
 
223
                }
 
224
 
 
225
                public bool AllowPropertyGetBlockInline { // tested
 
226
                        get;
 
227
                        set;
 
228
                }
 
229
 
 
230
                public bool AllowPropertySetBlockInline { // tested
 
231
                        get;
 
232
                        set;
 
233
                }
 
234
 
 
235
                public BraceStyle EventBraceStyle { // tested
 
236
                        get;
 
237
                        set;
 
238
                }
 
239
 
 
240
                public BraceStyle EventAddBraceStyle { // tested
 
241
                        get;
 
242
                        set;
 
243
                }
 
244
 
 
245
                public BraceStyle EventRemoveBraceStyle { // tested
 
246
                        get;
 
247
                        set;
 
248
                }
 
249
 
 
250
                public bool AllowEventAddBlockInline { // tested
 
251
                        get;
 
252
                        set;
 
253
                }
 
254
 
 
255
                public bool AllowEventRemoveBlockInline { // tested
 
256
                        get;
 
257
                        set;
 
258
                }
 
259
 
 
260
                public BraceStyle StatementBraceStyle { // tested
 
261
                        get;
 
262
                        set;
 
263
                }
 
264
 
 
265
                public bool AllowIfBlockInline {
 
266
                        get;
 
267
                        set;
 
268
                }
 
269
 
 
270
                bool allowOneLinedArrayInitialziers = true;
 
271
                public bool AllowOneLinedArrayInitialziers {
 
272
                        get {
 
273
                                return allowOneLinedArrayInitialziers;
 
274
                        }
 
275
                        set {
 
276
                                allowOneLinedArrayInitialziers = value;
 
277
                        }
 
278
                }
 
279
                #endregion
 
280
 
 
281
                #region NewLines
 
282
                public NewLinePlacement ElseNewLinePlacement { // tested
 
283
                        get;
 
284
                        set;
 
285
                }
 
286
 
 
287
                public NewLinePlacement ElseIfNewLinePlacement { // tested
 
288
                        get;
 
289
                        set;
 
290
                }
 
291
 
 
292
                public NewLinePlacement CatchNewLinePlacement { // tested
 
293
                        get;
 
294
                        set;
 
295
                }
 
296
 
 
297
                public NewLinePlacement FinallyNewLinePlacement { // tested
 
298
                        get;
 
299
                        set;
 
300
                }
 
301
 
 
302
                public NewLinePlacement WhileNewLinePlacement { // tested
 
303
                        get;
 
304
                        set;
 
305
                }
 
306
                #endregion
 
307
                
 
308
                #region Spaces
 
309
                // Methods
 
310
                public bool SpaceBeforeMethodDeclarationParentheses { // tested
 
311
                        get;
 
312
                        set;
 
313
                }
 
314
 
 
315
                public bool SpaceBetweenEmptyMethodDeclarationParentheses {
 
316
                        get;
 
317
                        set;
 
318
                }
 
319
 
 
320
                public bool SpaceBeforeMethodDeclarationParameterComma { // tested
 
321
                        get;
 
322
                        set;
 
323
                }
 
324
 
 
325
                public bool SpaceAfterMethodDeclarationParameterComma { // tested
 
326
                        get;
 
327
                        set;
 
328
                }
 
329
 
 
330
                public bool SpaceWithinMethodDeclarationParentheses { // tested
 
331
                        get;
 
332
                        set;
 
333
                }
 
334
                
 
335
                // Method calls
 
336
                public bool SpaceBeforeMethodCallParentheses { // tested
 
337
                        get;
 
338
                        set;
 
339
                }
 
340
 
 
341
                public bool SpaceBetweenEmptyMethodCallParentheses { // tested
 
342
                        get;
 
343
                        set;
 
344
                }
 
345
 
 
346
                public bool SpaceBeforeMethodCallParameterComma { // tested
 
347
                        get;
 
348
                        set;
 
349
                }
 
350
 
 
351
                public bool SpaceAfterMethodCallParameterComma { // tested
 
352
                        get;
 
353
                        set;
 
354
                }
 
355
 
 
356
                public bool SpaceWithinMethodCallParentheses { // tested
 
357
                        get;
 
358
                        set;
 
359
                }
 
360
                
 
361
                // fields
 
362
                
 
363
                public bool SpaceBeforeFieldDeclarationComma { // tested
 
364
                        get;
 
365
                        set;
 
366
                }
 
367
 
 
368
                public bool SpaceAfterFieldDeclarationComma { // tested
 
369
                        get;
 
370
                        set;
 
371
                }
 
372
                
 
373
                // local variables
 
374
                
 
375
                public bool SpaceBeforeLocalVariableDeclarationComma { // tested
 
376
                        get;
 
377
                        set;
 
378
                }
 
379
 
 
380
                public bool SpaceAfterLocalVariableDeclarationComma { // tested
 
381
                        get;
 
382
                        set;
 
383
                }
 
384
                
 
385
                // constructors
 
386
                
 
387
                public bool SpaceBeforeConstructorDeclarationParentheses { // tested
 
388
                        get;
 
389
                        set;
 
390
                }
 
391
 
 
392
                public bool SpaceBetweenEmptyConstructorDeclarationParentheses { // tested
 
393
                        get;
 
394
                        set;
 
395
                }
 
396
 
 
397
                public bool SpaceBeforeConstructorDeclarationParameterComma { // tested
 
398
                        get;
 
399
                        set;
 
400
                }
 
401
 
 
402
                public bool SpaceAfterConstructorDeclarationParameterComma { // tested
 
403
                        get;
 
404
                        set;
 
405
                }
 
406
 
 
407
                public bool SpaceWithinConstructorDeclarationParentheses { // tested
 
408
                        get;
 
409
                        set;
 
410
                }
 
411
                
 
412
                // indexer
 
413
                public bool SpaceBeforeIndexerDeclarationBracket { // tested
 
414
                        get;
 
415
                        set;
 
416
                }
 
417
 
 
418
                public bool SpaceWithinIndexerDeclarationBracket { // tested
 
419
                        get;
 
420
                        set;
 
421
                }
 
422
 
 
423
                public bool SpaceBeforeIndexerDeclarationParameterComma {
 
424
                        get;
 
425
                        set;
 
426
                }
 
427
 
 
428
                public bool SpaceAfterIndexerDeclarationParameterComma {
 
429
                        get;
 
430
                        set;
 
431
                }
 
432
                
 
433
                // delegates
 
434
                
 
435
                public bool SpaceBeforeDelegateDeclarationParentheses {
 
436
                        get;
 
437
                        set;
 
438
                }
 
439
 
 
440
                public bool SpaceBetweenEmptyDelegateDeclarationParentheses {
 
441
                        get;
 
442
                        set;
 
443
                }
 
444
 
 
445
                public bool SpaceBeforeDelegateDeclarationParameterComma {
 
446
                        get;
 
447
                        set;
 
448
                }
 
449
 
 
450
                public bool SpaceAfterDelegateDeclarationParameterComma {
 
451
                        get;
 
452
                        set;
 
453
                }
 
454
 
 
455
                public bool SpaceWithinDelegateDeclarationParentheses {
 
456
                        get;
 
457
                        set;
 
458
                }
 
459
 
 
460
                public bool SpaceBeforeNewParentheses { // tested
 
461
                        get;
 
462
                        set;
 
463
                }
 
464
 
 
465
                public bool SpaceBeforeIfParentheses { // tested
 
466
                        get;
 
467
                        set;
 
468
                }
 
469
 
 
470
                public bool SpaceBeforeWhileParentheses { // tested
 
471
                        get;
 
472
                        set;
 
473
                }
 
474
 
 
475
                public bool SpaceBeforeForParentheses { // tested
 
476
                        get;
 
477
                        set;
 
478
                }
 
479
 
 
480
                public bool SpaceBeforeForeachParentheses { // tested
 
481
                        get;
 
482
                        set;
 
483
                }
 
484
 
 
485
                public bool SpaceBeforeCatchParentheses { // tested
 
486
                        get;
 
487
                        set;
 
488
                }
 
489
 
 
490
                public bool SpaceBeforeSwitchParentheses { // tested
 
491
                        get;
 
492
                        set;
 
493
                }
 
494
 
 
495
                public bool SpaceBeforeLockParentheses { // tested
 
496
                        get;
 
497
                        set;
 
498
                }
 
499
 
 
500
                public bool SpaceBeforeUsingParentheses { // tested
 
501
                        get;
 
502
                        set;
 
503
                }
 
504
 
 
505
                public bool SpaceAroundAssignment { // tested
 
506
                        get;
 
507
                        set;
 
508
                }
 
509
 
 
510
                public bool SpaceAroundLogicalOperator { // tested
 
511
                        get;
 
512
                        set;
 
513
                }
 
514
 
 
515
                public bool SpaceAroundEqualityOperator { // tested
 
516
                        get;
 
517
                        set;
 
518
                }
 
519
 
 
520
                public bool SpaceAroundRelationalOperator { // tested
 
521
                        get;
 
522
                        set;
 
523
                }
 
524
 
 
525
                public bool SpaceAroundBitwiseOperator { // tested
 
526
                        get;
 
527
                        set;
 
528
                }
 
529
 
 
530
                public bool SpaceAroundAdditiveOperator { // tested
 
531
                        get;
 
532
                        set;
 
533
                }
 
534
 
 
535
                public bool SpaceAroundMultiplicativeOperator { // tested
 
536
                        get;
 
537
                        set;
 
538
                }
 
539
 
 
540
                public bool SpaceAroundShiftOperator { // tested
 
541
                        get;
 
542
                        set;
 
543
                }
 
544
 
 
545
                public bool SpaceAroundNullCoalescingOperator {
 
546
                        get;
 
547
                        set;
 
548
                }
 
549
 
 
550
                public bool SpacesWithinParentheses { // tested
 
551
                        get;
 
552
                        set;
 
553
                }
 
554
 
 
555
                public bool SpacesWithinIfParentheses { // tested
 
556
                        get;
 
557
                        set;
 
558
                }
 
559
 
 
560
                public bool SpacesWithinWhileParentheses { // tested
 
561
                        get;
 
562
                        set;
 
563
                }
 
564
 
 
565
                public bool SpacesWithinForParentheses { // tested
 
566
                        get;
 
567
                        set;
 
568
                }
 
569
 
 
570
                public bool SpacesWithinForeachParentheses { // tested
 
571
                        get;
 
572
                        set;
 
573
                }
 
574
 
 
575
                public bool SpacesWithinCatchParentheses { // tested
 
576
                        get;
 
577
                        set;
 
578
                }
 
579
 
 
580
                public bool SpacesWithinSwitchParentheses { // tested
 
581
                        get;
 
582
                        set;
 
583
                }
 
584
 
 
585
                public bool SpacesWithinLockParentheses { // tested
 
586
                        get;
 
587
                        set;
 
588
                }
 
589
 
 
590
                public bool SpacesWithinUsingParentheses { // tested
 
591
                        get;
 
592
                        set;
 
593
                }
 
594
 
 
595
                public bool SpacesWithinCastParentheses { // tested
 
596
                        get;
 
597
                        set;
 
598
                }
 
599
 
 
600
                public bool SpacesWithinSizeOfParentheses { // tested
 
601
                        get;
 
602
                        set;
 
603
                }
 
604
 
 
605
                public bool SpaceBeforeSizeOfParentheses { // tested
 
606
                        get;
 
607
                        set;
 
608
                }
 
609
 
 
610
                public bool SpacesWithinTypeOfParentheses { // tested
 
611
                        get;
 
612
                        set;
 
613
                }
 
614
 
 
615
                public bool SpacesWithinNewParentheses { // tested
 
616
                        get;
 
617
                        set;
 
618
                }
 
619
 
 
620
                public bool SpacesBetweenEmptyNewParentheses { // tested
 
621
                        get;
 
622
                        set;
 
623
                }
 
624
 
 
625
                public bool SpaceBeforeNewParameterComma { // tested
 
626
                        get;
 
627
                        set;
 
628
                }
 
629
 
 
630
                public bool SpaceAfterNewParameterComma { // tested
 
631
                        get;
 
632
                        set;
 
633
                }
 
634
 
 
635
                public bool SpaceBeforeTypeOfParentheses { // tested
 
636
                        get;
 
637
                        set;
 
638
                }
 
639
 
 
640
                public bool SpacesWithinCheckedExpressionParantheses { // tested
 
641
                        get;
 
642
                        set;
 
643
                }
 
644
 
 
645
                public bool SpaceBeforeConditionalOperatorCondition { // tested
 
646
                        get;
 
647
                        set;
 
648
                }
 
649
 
 
650
                public bool SpaceAfterConditionalOperatorCondition { // tested
 
651
                        get;
 
652
                        set;
 
653
                }
 
654
 
 
655
                public bool SpaceBeforeConditionalOperatorSeparator { // tested
 
656
                        get;
 
657
                        set;
 
658
                }
 
659
 
 
660
                public bool SpaceAfterConditionalOperatorSeparator { // tested
 
661
                        get;
 
662
                        set;
 
663
                }
 
664
                
 
665
                // brackets
 
666
                public bool SpacesWithinBrackets { // tested
 
667
                        get;
 
668
                        set;
 
669
                }
 
670
 
 
671
                public bool SpacesBeforeBrackets { // tested
 
672
                        get;
 
673
                        set;
 
674
                }
 
675
 
 
676
                public bool SpaceBeforeBracketComma { // tested
 
677
                        get;
 
678
                        set;
 
679
                }
 
680
 
 
681
                public bool SpaceAfterBracketComma { // tested
 
682
                        get;
 
683
                        set;
 
684
                }
 
685
 
 
686
                public bool SpaceBeforeForSemicolon { // tested
 
687
                        get;
 
688
                        set;
 
689
                }
 
690
 
 
691
                public bool SpaceAfterForSemicolon { // tested
 
692
                        get;
 
693
                        set;
 
694
                }
 
695
 
 
696
                public bool SpaceAfterTypecast { // tested
 
697
                        get;
 
698
                        set;
 
699
                }
 
700
 
 
701
                public bool SpaceBeforeArrayDeclarationBrackets { // tested
 
702
                        get;
 
703
                        set;
 
704
                }
 
705
 
 
706
                public bool SpaceInNamedArgumentAfterDoubleColon {
 
707
                        get;
 
708
                        set;
 
709
                }
 
710
                #endregion
 
711
                
 
712
                #region Blank Lines
 
713
                public int BlankLinesBeforeUsings {
 
714
                        get;
 
715
                        set;
 
716
                }
 
717
 
 
718
                public int BlankLinesAfterUsings {
 
719
                        get;
 
720
                        set;
 
721
                }
 
722
 
 
723
                public int BlankLinesBeforeFirstDeclaration {
 
724
                        get;
 
725
                        set;
 
726
                }
 
727
 
 
728
                public int BlankLinesBetweenTypes {
 
729
                        get;
 
730
                        set;
 
731
                }
 
732
 
 
733
                public int BlankLinesBetweenFields {
 
734
                        get;
 
735
                        set;
 
736
                }
 
737
 
 
738
                public int BlankLinesBetweenEventFields {
 
739
                        get;
 
740
                        set;
 
741
                }
 
742
 
 
743
                public int BlankLinesBetweenMembers {
 
744
                        get;
 
745
                        set;
 
746
                }
 
747
 
 
748
                #endregion
 
749
 
 
750
 
 
751
                #region Keep formatting
 
752
                public bool KeepCommentsAtFirstColumn {
 
753
                        get;
 
754
                        set;
 
755
                }
 
756
                #endregion
 
757
 
 
758
                #region Wrapping
 
759
 
 
760
                public Wrapping ArrayInitializerWrapping {
 
761
                        get;
 
762
                        set;
 
763
                }
 
764
 
 
765
                public BraceStyle ArrayInitializerBraceStyle {
 
766
                        get;
 
767
                        set;
 
768
                }
 
769
 
 
770
                public Wrapping ChainedMethodCallWrapping {
 
771
                        get;
 
772
                        set;
 
773
                }
 
774
 
 
775
                public Wrapping MethodCallArgumentWrapping {
 
776
                        get;
 
777
                        set;
 
778
                }
 
779
 
 
780
                public NewLinePlacement NewLineAferMethodCallOpenParentheses {
 
781
                        get;
 
782
                        set;
 
783
                }
 
784
 
 
785
                public NewLinePlacement MethodCallClosingParenthesesOnNewLine {
 
786
                        get;
 
787
                        set;
 
788
                }
 
789
 
 
790
                public Wrapping IndexerArgumentWrapping {
 
791
                        get;
 
792
                        set;
 
793
                }
 
794
 
 
795
                public NewLinePlacement NewLineAferIndexerOpenBracket {
 
796
                        get;
 
797
                        set;
 
798
                }
 
799
 
 
800
                public NewLinePlacement IndexerClosingBracketOnNewLine {
 
801
                        get;
 
802
                        set;
 
803
                }
 
804
 
 
805
                public Wrapping MethodDeclarationParameterWrapping {
 
806
                        get;
 
807
                        set;
 
808
                }
 
809
 
 
810
                public NewLinePlacement NewLineAferMethodDeclarationOpenParentheses {
 
811
                        get;
 
812
                        set;
 
813
                }
 
814
 
 
815
                public NewLinePlacement MethodDeclarationClosingParenthesesOnNewLine {
 
816
                        get;
 
817
                        set;
 
818
                }
 
819
 
 
820
                public Wrapping IndexerDeclarationParameterWrapping {
 
821
                        get;
 
822
                        set;
 
823
                }
 
824
 
 
825
                public NewLinePlacement NewLineAferIndexerDeclarationOpenBracket {
 
826
                        get;
 
827
                        set;
 
828
                }
 
829
 
 
830
                public NewLinePlacement IndexerDeclarationClosingBracketOnNewLine {
 
831
                        get;
 
832
                        set;
 
833
                }
 
834
 
 
835
                public bool AlignToFirstIndexerArgument {
 
836
                        get;
 
837
                        set;
 
838
                }
 
839
 
 
840
                public bool AlignToFirstIndexerDeclarationParameter {
 
841
                        get;
 
842
                        set;
 
843
                }
 
844
 
 
845
                public bool AlignToFirstMethodCallArgument {
 
846
                        get;
 
847
                        set;
 
848
                }
 
849
 
 
850
                public bool AlignToFirstMethodDeclarationParameter {
 
851
                        get;
 
852
                        set;
 
853
                }
 
854
 
 
855
                #endregion
 
856
 
 
857
                #region Using Declarations
 
858
                public UsingPlacement UsingPlacement {
 
859
                        get;
 
860
                        set;
 
861
                }
 
862
                #endregion
 
863
 
 
864
                internal CSharpFormattingOptions()
 
865
                {
 
866
                }
 
867
 
 
868
                /*public static CSharpFormattingOptions Load (FilePath selectedFile)
 
869
                {
 
870
                        using (var stream = System.IO.File.OpenRead (selectedFile)) {
 
871
                                return Load (stream);
 
872
                        }
 
873
                }
 
874
 
 
875
                public static CSharpFormattingOptions Load (System.IO.Stream input)
 
876
                {
 
877
                        CSharpFormattingOptions result = FormattingOptionsFactory.CreateMonoOptions ();
 
878
                        result.Name = "noname";
 
879
                        using (XmlTextReader reader = new XmlTextReader (input)) {
 
880
                                while (reader.Read ()) {
 
881
                                        if (reader.NodeType == XmlNodeType.Element) {
 
882
                                                if (reader.LocalName == "Property") {
 
883
                                                        var info = typeof(CSharpFormattingOptions).GetProperty (reader.GetAttribute ("name"));
 
884
                                                        string valString = reader.GetAttribute ("value");
 
885
                                                        object value;
 
886
                                                        if (info.PropertyType == typeof(bool)) {
 
887
                                                                value = Boolean.Parse (valString);
 
888
                                                        } else if (info.PropertyType == typeof(int)) {
 
889
                                                                value = Int32.Parse (valString);
 
890
                                                        } else {
 
891
                                                                value = Enum.Parse (info.PropertyType, valString);
 
892
                                                        }
 
893
                                                        info.SetValue (result, value, null);
 
894
                                                } else if (reader.LocalName == "FormattingProfile") {
 
895
                                                        result.Name = reader.GetAttribute ("name");
 
896
                                                }
 
897
                                        } else if (reader.NodeType == XmlNodeType.EndElement && reader.LocalName == "FormattingProfile") {
 
898
                                                //Console.WriteLine ("result:" + result.Name);
 
899
                                                return result;
 
900
                                        }
 
901
                                }
 
902
                        }
 
903
                        return result;
 
904
                }
 
905
 
 
906
                public void Save (string fileName)
 
907
                {
 
908
                        using (var writer = new XmlTextWriter (fileName, Encoding.Default)) {
 
909
                                writer.Formatting = System.Xml.Formatting.Indented;
 
910
                                writer.Indentation = 1;
 
911
                                writer.IndentChar = '\t';
 
912
                                writer.WriteStartElement ("FormattingProfile");
 
913
                                writer.WriteAttributeString ("name", Name);
 
914
                                foreach (PropertyInfo info in typeof (CSharpFormattingOptions).GetProperties ()) {
 
915
                                        if (info.GetCustomAttributes (false).Any (o => o.GetType () == typeof(ItemPropertyAttribute))) {
 
916
                                                writer.WriteStartElement ("Property");
 
917
                                                writer.WriteAttributeString ("name", info.Name);
 
918
                                                writer.WriteAttributeString ("value", info.GetValue (this, null).ToString ());
 
919
                                                writer.WriteEndElement ();
 
920
                                        }
 
921
                                }
 
922
                                writer.WriteEndElement ();
 
923
                        }
 
924
                }
 
925
 
 
926
                public bool Equals (CSharpFormattingOptions other)
 
927
                {
 
928
                        foreach (PropertyInfo info in typeof (CSharpFormattingOptions).GetProperties ()) {
 
929
                                if (info.GetCustomAttributes (false).Any (o => o.GetType () == typeof(ItemPropertyAttribute))) {
 
930
                                        object val = info.GetValue (this, null);
 
931
                                        object otherVal = info.GetValue (other, null);
 
932
                                        if (val == null) {
 
933
                                                if (otherVal == null)
 
934
                                                        continue;
 
935
                                                return false;
 
936
                                        }
 
937
                                        if (!val.Equals (otherVal)) {
 
938
                                                //Console.WriteLine ("!equal");
 
939
                                                return false;
 
940
                                        }
 
941
                                }
 
942
                        }
 
943
                        //Console.WriteLine ("== equal");
 
944
                        return true;
 
945
                }*/
 
946
        }
 
947
}