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

  1. //------------------------------------------------------------------------------
  2. // <copyright file="CodeIndexerExpression.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 array indexer expression.
  27.     /// </para>
  28.     /// </devdoc>
  29.     [ClassInterface(ClassInterfaceType.AutoDispatch), ComVisible(true), Serializable()]
  30.     public class CodeIndexerExpression : CodeExpression
  31.     {
  32.         private CodeExpression targetObject;
  33.         private CodeExpressionCollection indices;
  34.        
  35.         /// <devdoc>
  36.         /// <para>
  37.         /// Initializes a new instance of <see cref='System.CodeDom.CodeIndexerExpression'/>.
  38.         /// </para>
  39.         /// </devdoc>
  40.         public CodeIndexerExpression()
  41.         {
  42.         }
  43.        
  44.         /// <devdoc>
  45.         /// <para>
  46.         /// Initializes a new instance of <see cref='System.CodeDom.CodeIndexerExpression'/> using the specified target
  47.         /// object and index.
  48.         /// </para>
  49.         /// </devdoc>
  50.         public CodeIndexerExpression(CodeExpression targetObject, params CodeExpression[] indices)
  51.         {
  52.             this.targetObject = targetObject;
  53.             this.indices = new CodeExpressionCollection();
  54.             this.indices.AddRange(indices);
  55.         }
  56.        
  57.         /// <devdoc>
  58.         /// <para>
  59.         /// Gets or sets
  60.         /// the target object.
  61.         /// </para>
  62.         /// </devdoc>
  63.         public CodeExpression TargetObject {
  64.             get { return targetObject; }
  65.             set { targetObject = value; }
  66.         }
  67.        
  68.         /// <devdoc>
  69.         /// <para>
  70.         /// Gets or sets
  71.         /// the index.
  72.         /// </para>
  73.         /// </devdoc>
  74.         public CodeExpressionCollection Indices {
  75.             get {
  76.                 if (indices == null) {
  77.                     indices = new CodeExpressionCollection();
  78.                 }
  79.                 return indices;
  80.             }
  81.         }
  82.     }
  83. }

Developer Fusion