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

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

Developer Fusion