The Labs \ Source Viewer \ SSCLI \ System.CodeDom \ CodeTypeParameter

  1. //------------------------------------------------------------------------------
  2. // <copyright file="CodeTypeParameter.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. namespace System.CodeDom
  16. {
  17.    
  18.     using System.Diagnostics;
  19.     using System;
  20.     using Microsoft.Win32;
  21.     using System.Collections;
  22.     using System.Reflection;
  23.     using System.Runtime.InteropServices;
  24.    
  25.     [ClassInterface(ClassInterfaceType.AutoDispatch), ComVisible(true), Serializable()]
  26.     public class CodeTypeParameter : CodeObject
  27.     {
  28.         private string name;
  29.         private CodeAttributeDeclarationCollection customAttributes;
  30.         private CodeTypeReferenceCollection constraints;
  31.         private bool hasConstructorConstraint;
  32.        
  33.         public CodeTypeParameter()
  34.         {
  35.         }
  36.        
  37.         public CodeTypeParameter(string name)
  38.         {
  39.             this.name = name;
  40.         }
  41.        
  42.         public string Name {
  43.             get { return (name == null) ? string.Empty : name; }
  44.             set { name = value; }
  45.         }
  46.        
  47.         public CodeTypeReferenceCollection Constraints {
  48.             get {
  49.                 if (constraints == null) {
  50.                     constraints = new CodeTypeReferenceCollection();
  51.                 }
  52.                 return constraints;
  53.             }
  54.         }
  55.        
  56.         public CodeAttributeDeclarationCollection CustomAttributes {
  57.             get {
  58.                 if (customAttributes == null) {
  59.                     customAttributes = new CodeAttributeDeclarationCollection();
  60.                 }
  61.                 return customAttributes;
  62.             }
  63.         }
  64.        
  65.         public bool HasConstructorConstraint {
  66.             get { return hasConstructorConstraint; }
  67.             set { hasConstructorConstraint = value; }
  68.         }
  69.        
  70.     }
  71. }

Developer Fusion