Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System.Data.Entity.Design / System / Data / EntityModel / Emitters / ComplexTypeEmitter.cs
1 //---------------------------------------------------------------------
2 // <copyright file="ComplexTypeEmitter.cs" company="Microsoft">
3 //      Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //
6 // @owner       Microsoft
7 // @backupOwner Microsoft
8 //---------------------------------------------------------------------
9
10 using System;
11 using System.CodeDom;
12 using System.Data;
13 using System.Data.Metadata.Edm;
14 using System.Data.EntityModel.SchemaObjectModel;
15
16
17 namespace System.Data.EntityModel.Emitters
18 {
19     /// <summary>
20     /// Summary description for NestedTypeEmitter.
21     /// </summary>
22     internal sealed class ComplexTypeEmitter : StructuredTypeEmitter
23     {
24         #region Methods
25         /// <summary>
26         /// 
27         /// </summary>
28         /// <param name="generator"></param>
29         /// <param name="nestedType"></param>
30         public ComplexTypeEmitter(ClientApiGenerator generator, ComplexType complexType)
31             : base(generator, complexType)
32         {
33         }
34
35
36         /// <summary>
37         /// Apply the attributes to this type.
38         /// </summary>
39         /// <param name="typeDecl">The declaration of the type that should have attributes added to it.</param>
40         protected override void EmitTypeAttributes( CodeTypeDeclaration typeDecl )
41         {
42             Generator.AttributeEmitter.EmitTypeAttributes( this, typeDecl );
43             base.EmitTypeAttributes( typeDecl );
44         }
45         #endregion
46         #region Protected Properties
47
48         /// <summary>
49         /// 
50         /// </summary>
51         /// <returns></returns>
52         protected override CodeTypeReference GetBaseType()
53         {
54             CodeTypeReference baseType = base.GetBaseType();
55             if (baseType == null)
56             {
57                 baseType = TypeReference.ComplexTypeBaseClass;
58             }
59             return baseType;
60         }
61
62         protected override ReadOnlyMetadataCollection<EdmProperty> GetProperties()
63         {
64             return Item.Properties;
65         }
66
67         internal new ComplexType Item
68         {
69             get
70             {
71                 return base.Item as ComplexType;
72             }
73         }
74
75         #endregion
76
77     }
78 }