Initial commit
[mono.git] / mcs / class / referencesource / System / compmod / system / codedom / CodeTypeParameter.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="CodeTypeParameter.cs" company="Microsoft">
3 // 
4 // <OWNER>[....]</OWNER>
5 //     Copyright (c) Microsoft Corporation.  All rights reserved.
6 // </copyright>                                                                
7 //------------------------------------------------------------------------------
8
9 namespace System.CodeDom {
10
11     using System.Diagnostics;
12     using System;
13     using Microsoft.Win32;
14     using System.Collections;
15     using System.Reflection;
16     using System.Runtime.InteropServices;
17
18     [
19         ClassInterface(ClassInterfaceType.AutoDispatch),
20         ComVisible(true),
21         Serializable,
22     ]
23     public class CodeTypeParameter : CodeObject {
24         private string name;
25         private CodeAttributeDeclarationCollection customAttributes;
26         private CodeTypeReferenceCollection constraints;
27         private bool hasConstructorConstraint;
28
29         public CodeTypeParameter() {
30         }
31
32         public CodeTypeParameter(string name) {
33             this.name = name;
34         }
35
36         public string Name {
37             get {
38                 return (name == null) ? string.Empty : name;
39             }
40             set {
41                 name = value;
42             }
43         }
44
45         public CodeTypeReferenceCollection Constraints {  
46             get {
47                 if (constraints == null) {
48                     constraints = new CodeTypeReferenceCollection();
49                 }
50                 return constraints;
51             }
52         } 
53
54         public CodeAttributeDeclarationCollection CustomAttributes {
55             get {
56                 if (customAttributes == null) {
57                     customAttributes = new CodeAttributeDeclarationCollection();
58                 }
59                 return customAttributes;
60             }
61         }
62
63         public bool HasConstructorConstraint {
64             get {
65                 return hasConstructorConstraint;
66             } 
67             set {
68                 hasConstructorConstraint = value;
69             }
70         }
71
72     }
73 }
74
75