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

  1. //------------------------------------------------------------------------------
  2. // <copyright file="CodeAttributeArgument.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.Runtime.InteropServices;
  23.    
  24.     /// <devdoc>
  25.     /// <para>
  26.     /// Represents an argument for use in a custom attribute declaration.
  27.     /// </para>
  28.     /// </devdoc>
  29.     [ClassInterface(ClassInterfaceType.AutoDispatch), ComVisible(true), Serializable()]
  30.     public class CodeAttributeArgument
  31.     {
  32.         private string name;
  33.         private CodeExpression value;
  34.        
  35.         /// <devdoc>
  36.         /// <para>
  37.         /// Initializes a new instance of <see cref='System.CodeDom.CodeAttributeArgument'/>.
  38.         /// </para>
  39.         /// </devdoc>
  40.         public CodeAttributeArgument()
  41.         {
  42.         }
  43.        
  44.         /// <devdoc>
  45.         /// <para>
  46.         /// Initializes a new instance of <see cref='System.CodeDom.CodeAttributeArgument'/> using the specified value.
  47.         /// </para>
  48.         /// </devdoc>
  49.         public CodeAttributeArgument(CodeExpression value)
  50.         {
  51.             Value = value;
  52.         }
  53.        
  54.         /// <devdoc>
  55.         /// <para>
  56.         /// Initializes a new instance of <see cref='System.CodeDom.CodeAttributeArgument'/> using the specified name and
  57.         /// value.
  58.         /// </para>
  59.         /// </devdoc>
  60.         public CodeAttributeArgument(string name, CodeExpression value)
  61.         {
  62.             Name = name;
  63.             Value = value;
  64.         }
  65.        
  66.         /// <devdoc>
  67.         /// <para>
  68.         /// The name of the attribute.
  69.         /// </para>
  70.         /// </devdoc>
  71.         public string Name {
  72.             get { return (name == null) ? string.Empty : name; }
  73.             set { name = value; }
  74.         }
  75.        
  76.         /// <devdoc>
  77.         /// <para>
  78.         /// The argument for the attribute.
  79.         /// </para>
  80.         /// </devdoc>
  81.         public CodeExpression Value {
  82.             get { return value; }
  83.             set { this.value = value; }
  84.         }
  85.     }
  86. }

Developer Fusion