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

  1. //------------------------------------------------------------------------------
  2. // <copyright file="CodePropertyReferenceExpression.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 a reference to a property.
  27.     /// </para>
  28.     /// </devdoc>
  29.     [ClassInterface(ClassInterfaceType.AutoDispatch), ComVisible(true), Serializable()]
  30.     public class CodePropertyReferenceExpression : CodeExpression
  31.     {
  32.         private CodeExpression targetObject;
  33.         private string propertyName;
  34.         private CodeExpressionCollection parameters = new CodeExpressionCollection();
  35.        
  36.         /// <devdoc>
  37.         /// <para>
  38.         /// Initializes a new instance of <see cref='System.CodeDom.CodePropertyReferenceExpression'/>.
  39.         /// </para>
  40.         /// </devdoc>
  41.         public CodePropertyReferenceExpression()
  42.         {
  43.         }
  44.        
  45.         /// <devdoc>
  46.         /// <para>
  47.         /// Initializes a new instance of <see cref='System.CodeDom.CodePropertyReferenceExpression'/> using the specified target object and property
  48.         /// name.
  49.         /// </para>
  50.         /// </devdoc>
  51.         public CodePropertyReferenceExpression(CodeExpression targetObject, string propertyName)
  52.         {
  53.             TargetObject = targetObject;
  54.             PropertyName = propertyName;
  55.         }
  56.        
  57.         /// <devdoc>
  58.         /// <para>
  59.         /// The target object containing the property this <see cref='System.CodeDom.CodePropertyReferenceExpression'/> references.
  60.         /// </para>
  61.         /// </devdoc>
  62.         public CodeExpression TargetObject {
  63.             get { return targetObject; }
  64.             set { targetObject = value; }
  65.         }
  66.        
  67.         /// <devdoc>
  68.         /// <para>
  69.         /// The name of the property to reference.
  70.         /// </para>
  71.         /// </devdoc>
  72.         public string PropertyName {
  73.             get { return (propertyName == null) ? string.Empty : propertyName; }
  74.             set { propertyName = value; }
  75.         }
  76.     }
  77. }

Developer Fusion