~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric

« back to all changes in this revision

Viewing changes to src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
ImportĀ upstreamĀ versionĀ 2.5.92+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
25
// THE SOFTWARE.
26
26
using System;
27
 
using MonoDevelop.CSharp.Dom;
 
27
using MonoDevelop.CSharp.Ast;
28
28
using MonoDevelop.Projects.Dom.Output;
29
29
using MonoDevelop.Projects.Dom;
30
30
using System.Text;
42
42
                OutputVisitor visitor;
43
43
                CSharpFormattingPolicy policy;
44
44
                
 
45
                public CSharpFormattingPolicy Policy {
 
46
                        get {
 
47
                                return this.policy;
 
48
                        }
 
49
                        set {
 
50
                                policy = value;
 
51
                        }
 
52
                }
 
53
                
45
54
                public CSharpCodeGenerator ()
46
55
                {
47
56
                        visitor = new OutputVisitor (this);
61
70
                        StringBuilder result = new StringBuilder ();
62
71
                        AppendIndent (result);
63
72
                        result.Append ("#region ");
64
 
                        result.AppendLine (regionName);
65
 
                        result.AppendLine (text);
 
73
                        result.Append (regionName);
 
74
                        AppendLine (result);
 
75
                        result.Append (text);
 
76
                        AppendLine (result);
66
77
                        AppendIndent (result);
67
78
                        result.Append ("#endregion");
68
79
                        return result.ToString ();
83
94
                {
84
95
                        switch (braceStyle) {
85
96
                        case BraceStyle.EndOfLine:
86
 
                                result.AppendLine (" {");
 
97
                                result.Append (" {");
 
98
                                AppendLine (result);
87
99
                                break;
88
100
                        case BraceStyle.EndOfLineWithoutSpace:
89
 
                                result.AppendLine ("{");
 
101
                                result.Append ("{");
 
102
                                AppendLine (result);
90
103
                                break;
91
104
                        case BraceStyle.NextLine:
92
 
                                result.AppendLine ();
 
105
                                AppendLine (result);
93
106
                                AppendIndent (result);
94
 
                                result.AppendLine ("{");
 
107
                                result.Append ("{");
 
108
                                AppendLine (result);
95
109
                                break;
96
110
                        case BraceStyle.NextLineShifted:
97
 
                                result.AppendLine ();
 
111
                                AppendLine (result);
98
112
                                result.Append (GetIndent (IndentLevel + 1));
99
 
                                result.AppendLine ("{");
 
113
                                result.Append ("{");
 
114
                                AppendLine (result);
100
115
                                break;
101
116
                        case BraceStyle.NextLineShifted2:
102
 
                                result.AppendLine ();
 
117
                                AppendLine (result);
103
118
                                result.Append (GetIndent (IndentLevel + 1));
104
 
                                result.AppendLine ("{");
 
119
                                result.Append ("{");
 
120
                                AppendLine (result);
105
121
                                IndentLevel++;
106
122
                                break;
107
123
                        default:
203
219
                                        result.Append ("add");
204
220
                                        generator.AppendBraceStart (result, generator.policy.EventAddBraceStyle);
205
221
                                        generator.AppendIndent (result);
206
 
                                        result.AppendLine ("// TODO");
 
222
                                        result.Append ("// TODO");
 
223
                                        generator.AppendLine (result);
207
224
                                        generator.AppendBraceEnd (result, generator.policy.EventAddBraceStyle);
208
225
                                        
209
226
                                        generator.AppendIndent (result);
210
227
                                        result.Append ("remove");
211
228
                                        generator.AppendBraceStart (result, generator.policy.EventRemoveBraceStyle);
212
229
                                        generator.AppendIndent (result);
213
 
                                        result.AppendLine ("// TODO");
 
230
                                        result.Append ("// TODO");
 
231
                                        generator.AppendLine (result);
 
232
                                        
214
233
                                        generator.AppendBraceEnd (result, generator.policy.EventRemoveBraceStyle);
215
234
                                        generator.AppendBraceEnd (result, generator.policy.EventBraceStyle);
216
235
                                } else {
230
249
                                        result.Append (" ");
231
250
                                result.Append ("();");
232
251
                                bodyEndOffset = result.Length;
233
 
                                result.AppendLine ();
 
252
                                generator.AppendLine (result);
234
253
                        }
235
254
                        
236
255
                        public void AppendMonoTouchTodo (StringBuilder result, out int bodyStartOffset, out int bodyEndOffset)
239
258
                                bodyStartOffset = result.Length;
240
259
                                result.Append ("// TODO: Implement - see: http://go-mono.com/docs/index.aspx?link=T%3aMonoTouch.Foundation.ModelAttribute");
241
260
                                bodyEndOffset = result.Length;
242
 
                                result.AppendLine ();
 
261
                                generator.AppendLine (result);
243
262
                        }
244
263
                        
245
264
                        public override CodeGeneratorMemberResult Visit (IMethod method, CodeGenerationOptions options)
250
269
                                AppendReturnType (result, options.ImplementingType, method.ReturnType);
251
270
                                result.Append (" ");
252
271
                                if (options.ExplicitDeclaration) {
253
 
                                        result.Append (ambience.GetString (new DomReturnType (method.DeclaringType), OutputFlags.IncludeGenerics));
 
272
                                        AppendReturnType (result, options.ImplementingType, new DomReturnType (method.DeclaringType));
254
273
                                        result.Append (".");
255
274
                                }
256
275
                                result.Append (method.Name);
270
289
                                AppendParameterList (result, options.ImplementingType, method.Parameters);
271
290
                                result.Append (")");
272
291
                                
273
 
                                generator.AppendBraceStart (result, generator.policy.MethodBraceStyle);
274
 
                                if (method.Name == "ToString" && (method.Parameters == null || method.Parameters.Count == 0) && method.ReturnType != null && method.ReturnType.FullName == "System.String") {
275
 
                                        generator.AppendIndent (result);
276
 
                                        bodyStartOffset = result.Length;
277
 
                                        result.Append ("return string.Format");
278
 
                                        if (generator.policy.BeforeMethodDeclarationParentheses)
279
 
                                                result.Append (" ");
280
 
                                        result.Append ("(\"[");
281
 
                                        result.Append (options.ImplementingType.Name);
282
 
                                        if (options.ImplementingType.PropertyCount > 0) 
283
 
                                                result.Append (": ");
284
 
                                        int i = 0;
285
 
                                        foreach (IProperty property in options.ImplementingType.Properties) {
286
 
                                                if (property.IsStatic || !property.IsPublic)
287
 
                                                        continue;
288
 
                                                if (i > 0)
289
 
                                                        result.Append (", ");
290
 
                                                result.Append (property.Name);
291
 
                                                result.Append ("={");
292
 
                                                result.Append (i++);
293
 
                                                result.Append ("}");
294
 
                                        }
295
 
                                        result.Append ("]\"");
296
 
                                        foreach (IProperty property in options.ImplementingType.Properties) {
297
 
                                                if (property.IsStatic || !property.IsPublic)
298
 
                                                        continue;
299
 
                                                result.Append (", ");
300
 
                                                result.Append (property.Name);
301
 
                                        }
302
 
                                        result.Append (");");
303
 
                                        bodyEndOffset = result.Length;
304
 
                                        result.AppendLine ();
305
 
                                } else if (IsMonoTouchModelMember (method)) {
306
 
                                        AppendMonoTouchTodo (result, out bodyStartOffset, out bodyEndOffset);
307
 
                                } else if (method.IsAbstract || method.DeclaringType.ClassType == ClassType.Interface) {
308
 
                                        AppendNotImplementedException (result, options, out bodyStartOffset, out bodyEndOffset);
309
 
                                } else {
310
 
                                        generator.AppendIndent (result);
311
 
                                        bodyStartOffset = result.Length;
312
 
                                        if (method.ReturnType.FullName != DomReturnType.Void.FullName)
313
 
                                                result.Append ("return ");
314
 
                                        result.Append ("base.");
315
 
                                        result.Append (method.Name);
316
 
                                        if (generator.policy.BeforeMethodCallParentheses)
317
 
                                                result.Append (" ");
318
 
                                        result.Append ("(");
319
 
                                        for (int i = 0; i < method.Parameters.Count; i++) {
320
 
                                                if (i > 0)
 
292
                                var typeParameters = method.TypeParameters;
 
293
                                if (typeParameters.Any (p => p.Constraints.Any () || (p.TypeParameterModifier & TypeParameterModifier.HasDefaultConstructorConstraint) != 0)) {
 
294
                                        result.Append (" where ");
 
295
                                        int typeParameterCount = 0;
 
296
                                        foreach (var p in typeParameters) {
 
297
                                                if (!p.Constraints.Any () && (p.TypeParameterModifier & TypeParameterModifier.HasDefaultConstructorConstraint) == 0)
 
298
                                                        continue;
 
299
                                                if (typeParameterCount != 0)
321
300
                                                        result.Append (", ");
322
301
                                                
323
 
                                                var p = method.Parameters[i];
324
 
                                                if (p.IsOut)
325
 
                                                        result.Append ("out ");
326
 
                                                if (p.IsRef)
327
 
                                                        result.Append ("ref ");
 
302
                                                typeParameterCount++;
328
303
                                                result.Append (p.Name);
329
 
                                        }
330
 
                                        result.Append (");");
331
 
                                        bodyEndOffset = result.Length;
332
 
                                        result.AppendLine ();
333
 
                                }
334
 
                                generator.AppendBraceEnd (result, generator.policy.MethodBraceStyle);
 
304
                                                result.Append (" : ");
 
305
                                                int constraintCount = 0;
 
306
                                
 
307
                                                if ((p.TypeParameterModifier & TypeParameterModifier.HasDefaultConstructorConstraint) != 0) {
 
308
                                                        result.Append ("new ()");
 
309
                                                        constraintCount++;
 
310
                                                }
 
311
                                                foreach (var c in p.Constraints) {
 
312
                                                        if (constraintCount != 0)
 
313
                                                                result.Append (", ");
 
314
                                                        constraintCount++;
 
315
                                                        if (c.DecoratedFullName == DomReturnType.ValueType.DecoratedFullName) {
 
316
                                                                result.Append ("struct");
 
317
                                                                continue;
 
318
                                                        }
 
319
                                                        if (c.DecoratedFullName == DomReturnType.Object.DecoratedFullName) {
 
320
                                                                result.Append ("class");
 
321
                                                                continue;
 
322
                                                        }
 
323
                                                        AppendReturnType (result, options.ImplementingType, c);
 
324
                                                }
 
325
                                        }
 
326
                                }
 
327
                                
 
328
                                if (options.ImplementingType.ClassType == ClassType.Interface) {
 
329
                                        result.Append (";");
 
330
                                } else {
 
331
                                        generator.AppendBraceStart (result, generator.policy.MethodBraceStyle);
 
332
                                        if (method.Name == "ToString" && (method.Parameters == null || method.Parameters.Count == 0) && method.ReturnType != null && method.ReturnType.FullName == "System.String") {
 
333
                                                generator.AppendIndent (result);
 
334
                                                bodyStartOffset = result.Length;
 
335
                                                result.Append ("return string.Format");
 
336
                                                if (generator.policy.BeforeMethodDeclarationParentheses)
 
337
                                                        result.Append (" ");
 
338
                                                result.Append ("(\"[");
 
339
                                                result.Append (options.ImplementingType.Name);
 
340
                                                if (options.ImplementingType.PropertyCount > 0) 
 
341
                                                        result.Append (": ");
 
342
                                                int i = 0;
 
343
                                                foreach (IProperty property in options.ImplementingType.Properties) {
 
344
                                                        if (property.IsStatic || !property.IsPublic)
 
345
                                                                continue;
 
346
                                                        if (i > 0)
 
347
                                                                result.Append (", ");
 
348
                                                        result.Append (property.Name);
 
349
                                                        result.Append ("={");
 
350
                                                        result.Append (i++);
 
351
                                                        result.Append ("}");
 
352
                                                }
 
353
                                                result.Append ("]\"");
 
354
                                                foreach (IProperty property in options.ImplementingType.Properties) {
 
355
                                                        if (property.IsStatic || !property.IsPublic)
 
356
                                                                continue;
 
357
                                                        result.Append (", ");
 
358
                                                        result.Append (property.Name);
 
359
                                                }
 
360
                                                result.Append (");");
 
361
                                                bodyEndOffset = result.Length;
 
362
                                                generator.AppendLine (result);
 
363
                                        } else if (IsMonoTouchModelMember (method)) {
 
364
                                                AppendMonoTouchTodo (result, out bodyStartOffset, out bodyEndOffset);
 
365
                                        } else if (method.IsAbstract || !(method.IsVirtual || method.IsOverride) || method.DeclaringType.ClassType == ClassType.Interface) {
 
366
                                                AppendNotImplementedException (result, options, out bodyStartOffset, out bodyEndOffset);
 
367
                                        } else {
 
368
                                                generator.AppendIndent (result);
 
369
                                                bodyStartOffset = result.Length;
 
370
                                                if (method.ReturnType.FullName != DomReturnType.Void.FullName)
 
371
                                                        result.Append ("return ");
 
372
                                                result.Append ("base.");
 
373
                                                result.Append (method.Name);
 
374
                                                if (generator.policy.BeforeMethodCallParentheses)
 
375
                                                        result.Append (" ");
 
376
                                                result.Append ("(");
 
377
                                                for (int i = 0; i < method.Parameters.Count; i++) {
 
378
                                                        if (i > 0)
 
379
                                                                result.Append (", ");
 
380
                                                        
 
381
                                                        var p = method.Parameters[i];
 
382
                                                        if (p.IsOut)
 
383
                                                                result.Append ("out ");
 
384
                                                        if (p.IsRef)
 
385
                                                                result.Append ("ref ");
 
386
                                                        result.Append (p.Name);
 
387
                                                }
 
388
                                                result.Append (");");
 
389
                                                bodyEndOffset = result.Length;
 
390
                                                generator.AppendLine (result);
 
391
                                        }
 
392
                                        generator.AppendBraceEnd (result, generator.policy.MethodBraceStyle);
 
393
                                }
335
394
                                return new CodeGeneratorMemberResult (result.ToString (), bodyStartOffset, bodyEndOffset);
336
395
                        }
337
396
                        
356
415
                        
357
416
                        static string GetModifiers (IType implementingType, IMember member)
358
417
                        {
359
 
                                if (member.IsPublic || member.DeclaringType.ClassType == ClassType.Interface) 
360
 
                                        return "public ";
361
 
                                if (member.IsPrivate) 
362
 
                                        return "";
 
418
                                StringBuilder result = new StringBuilder ();
 
419
                                if (member.IsPublic || (member.DeclaringType != null && member.DeclaringType.ClassType == ClassType.Interface)) {
 
420
                                        result.Append ("public ");
 
421
                                } else if (member.IsProtectedAndInternal) {
 
422
                                        result.Append ("protected internal ");
 
423
                                } else if (member.IsProtectedOrInternal && (member.DeclaringType != null && implementingType.SourceProjectDom == member.DeclaringType.SourceProjectDom)) {
 
424
                                        result.Append ("internal protected ");
 
425
                                } else if (member.IsProtected) {
 
426
                                        result.Append ("protected ");
 
427
                                } else if (member.IsInternal) {
 
428
                                        result.Append ("internal ");
 
429
                                }
363
430
                                        
364
 
                                if (member.IsProtectedAndInternal) 
365
 
                                        return "protected internal ";
366
 
                                if (member.IsProtectedOrInternal && implementingType.SourceProjectDom == member.DeclaringType.SourceProjectDom) 
367
 
                                        return "internal protected ";
 
431
                                if (member.IsStatic) 
 
432
                                        result.Append ("static ");
368
433
                                
369
 
                                if (member.IsProtected) 
370
 
                                        return "protected ";
371
 
                                if (member.IsInternal) 
372
 
                                        return "internal ";
373
 
                                        
374
 
                                return "";
 
434
                                return result.ToString ();
375
435
                        }
376
436
                        
377
437
                        void AppendModifiers (StringBuilder result, CSharpCodeGenerator.CodeGenerationOptions options, IMember member)
378
438
                        {
379
439
                                generator.AppendIndent (result);
380
 
                                if (options.ExplicitDeclaration)
 
440
                                if (options.ExplicitDeclaration || options.ImplementingType.ClassType == ClassType.Interface)
381
441
                                        return;
382
442
                                result.Append (GetModifiers (options.ImplementingType, member));
383
443
                                
384
 
                                if ((member.Modifiers & Modifiers.Virtual) == Modifiers.Virtual ||
385
 
                                    (member.Modifiers & Modifiers.Abstract) == Modifiers.Abstract)
 
444
                                bool isFromInterface = false;
 
445
                                if (member.DeclaringType != null && member.DeclaringType.ClassType == ClassType.Interface) {
 
446
                                        isFromInterface = true;
 
447
                                        if (options.ImplementingType != null) {
 
448
                                                foreach (IType type in options.ImplementingType.SourceProjectDom.GetInheritanceTree (options.ImplementingType)) {
 
449
                                                        if (type.ClassType == ClassType.Interface)
 
450
                                                                continue;
 
451
                                                        if (type.SearchMember (member.Name, true).Any (m => m.Name == member.Name && member.MemberType == m.MemberType && DomMethod.ParameterListEquals (member.Parameters, m.Parameters))) {
 
452
                                                                isFromInterface = false;
 
453
                                                                break;
 
454
                                                        }
 
455
                                                }
 
456
                                        }
 
457
                                }
 
458
                                if (!isFromInterface && ((member.Modifiers & Modifiers.Virtual) == Modifiers.Virtual || 
 
459
                                        (member.Modifiers & Modifiers.Abstract) == Modifiers.Abstract))
386
460
                                        result.Append ("override ");
387
461
                        }
388
462
                        
409
483
                                        int bodyStartOffset, bodyEndOffset;
410
484
                                        generator.AppendIndent (result);
411
485
                                        result.Append ("get");
412
 
                                        generator.AppendBraceStart (result, generator.policy.PropertyGetBraceStyle);
413
 
                                        if (IsMonoTouchModelMember (property)) {
414
 
                                                AppendMonoTouchTodo (result, out bodyStartOffset, out bodyEndOffset);
415
 
                                        } else if (property.IsAbstract || property.DeclaringType.ClassType == ClassType.Interface) {
416
 
                                                AppendNotImplementedException (result, options, out bodyStartOffset, out bodyEndOffset);
 
486
                                        if (options.ImplementingType.ClassType == ClassType.Interface) {
 
487
                                                result.AppendLine (";");
417
488
                                        } else {
418
 
                                                generator.AppendIndent (result);
419
 
                                                bodyStartOffset = result.Length;
420
 
                                                result.Append ("return base.");
421
 
                                                result.Append (property.Name);
422
 
                                                result.Append (";");
423
 
                                                bodyEndOffset = result.Length;
424
 
                                                result.AppendLine ();
 
489
                                                generator.AppendBraceStart (result, generator.policy.PropertyGetBraceStyle);
 
490
                                                if (IsMonoTouchModelMember (property)) {
 
491
                                                        AppendMonoTouchTodo (result, out bodyStartOffset, out bodyEndOffset);
 
492
                                                } else if (property.IsAbstract || property.DeclaringType.ClassType == ClassType.Interface) {
 
493
                                                        AppendNotImplementedException (result, options, out bodyStartOffset, out bodyEndOffset);
 
494
                                                } else {
 
495
                                                        generator.AppendIndent (result);
 
496
                                                        bodyStartOffset = result.Length;
 
497
                                                        result.Append ("return base.");
 
498
                                                        result.Append (property.Name);
 
499
                                                        result.Append (";");
 
500
                                                        bodyEndOffset = result.Length;
 
501
                                                        generator.AppendLine (result);
 
502
                                                }
 
503
                                                generator.AppendBraceEnd (result, generator.policy.PropertyGetBraceStyle);
 
504
                                                generator.AppendLine (result);
 
505
                                                regions.Add (new CodeGeneratorBodyRegion (bodyStartOffset, bodyEndOffset));
425
506
                                        }
426
 
                                        generator.AppendBraceEnd (result, generator.policy.PropertyGetBraceStyle);
427
 
                                        result.AppendLine ();
428
 
                                        regions.Add (new CodeGeneratorBodyRegion (bodyStartOffset, bodyEndOffset));
429
507
                                }
430
508
                                
431
509
                                if (property.HasSet) {
432
510
                                        int bodyStartOffset, bodyEndOffset;
433
511
                                        generator.AppendIndent (result);
434
512
                                        result.Append ("set");
435
 
                                        generator.AppendBraceStart (result, generator.policy.PropertyGetBraceStyle);
436
 
                                        if (IsMonoTouchModelMember (property)) {
437
 
                                                AppendMonoTouchTodo (result, out bodyStartOffset, out bodyEndOffset);
438
 
                                        } else if (property.IsAbstract || property.DeclaringType.ClassType == ClassType.Interface) {
439
 
                                                AppendNotImplementedException (result, options, out bodyStartOffset, out bodyEndOffset);
 
513
                                        if (options.ImplementingType.ClassType == ClassType.Interface) {
 
514
                                                result.AppendLine (";");
440
515
                                        } else {
441
 
                                                generator.AppendIndent (result);
442
 
                                                bodyStartOffset = result.Length;
443
 
                                                result.Append ("base.");
444
 
                                                result.Append (property.Name);
445
 
                                                result.Append (" = value;");
446
 
                                                bodyEndOffset = result.Length;
447
 
                                                result.AppendLine ();
 
516
                                                generator.AppendBraceStart (result, generator.policy.PropertyGetBraceStyle);
 
517
                                                if (IsMonoTouchModelMember (property)) {
 
518
                                                        AppendMonoTouchTodo (result, out bodyStartOffset, out bodyEndOffset);
 
519
                                                } else if (property.IsAbstract || property.DeclaringType.ClassType == ClassType.Interface) {
 
520
                                                        AppendNotImplementedException (result, options, out bodyStartOffset, out bodyEndOffset);
 
521
                                                } else {
 
522
                                                        generator.AppendIndent (result);
 
523
                                                        bodyStartOffset = result.Length;
 
524
                                                        result.Append ("base.");
 
525
                                                        result.Append (property.Name);
 
526
                                                        result.Append (" = value;");
 
527
                                                        bodyEndOffset = result.Length;
 
528
                                                        generator.AppendLine (result);
 
529
                                                }
 
530
                                                generator.AppendBraceEnd (result, generator.policy.PropertyGetBraceStyle);
 
531
                                                generator.AppendLine (result);
 
532
                                                regions.Add (new CodeGeneratorBodyRegion (bodyStartOffset, bodyEndOffset));
448
533
                                        }
449
 
                                        generator.AppendBraceEnd (result, generator.policy.PropertyGetBraceStyle);
450
 
                                        result.AppendLine ();
451
 
                                        regions.Add (new CodeGeneratorBodyRegion (bodyStartOffset, bodyEndOffset));
452
 
                                                
453
534
                                }
454
535
                                generator.AppendBraceEnd (result, generator.policy.PropertyBraceStyle);
455
536
                                return new CodeGeneratorMemberResult (result.ToString (), regions);
462
543
                                return member.DeclaringType.Attributes.Any (attr => attr.AttributeType != null && attr.AttributeType.FullName == "MonoTouch.Foundation.ModelAttribute");
463
544
                        }
464
545
                }
465
 
        
466
 
                internal static string GetIndent (int indentLevel)
467
 
                {
468
 
                        return new string ('\t', indentLevel);
469
 
                }
470
 
                
 
546
 
471
547
                public override string CreateFieldEncapsulation (IType implementingType, IField field, string propertyName, Modifiers modifiers, bool readOnly)
472
548
                {
473
549
                        SetIndentTo (implementingType);
490
566
                        AppendIndent (result);
491
567
                        result.Append ("return this.");
492
568
                        result.Append (field.Name);
493
 
                        result.AppendLine (";");
 
569
                        result.Append (";");
 
570
                        AppendLine (result);
494
571
                        AppendBraceEnd (result, policy.PropertyGetBraceStyle);
495
 
                        result.AppendLine ();
 
572
                        AppendLine (result);
496
573
 
497
574
                        if (!readOnly) {
498
575
                                AppendIndent (result);
500
577
                                AppendBraceStart (result, policy.PropertyGetBraceStyle);
501
578
                                AppendIndent (result);
502
579
                                result.Append (field.Name);
503
 
                                result.AppendLine (" = value;");
 
580
                                result.Append (" = value;");
 
581
                                AppendLine (result);
504
582
                                AppendBraceEnd (result, policy.PropertyGetBraceStyle);
505
 
                                result.AppendLine ();
 
583
                                AppendLine (result);
506
584
                        }
507
585
                        
508
586
                        AppendBraceEnd (result, policy.PropertyBraceStyle);