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

  1. //------------------------------------------------------------------------------
  2. // <copyright file="CodeRemoveEventStatement.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 event detach statement.
  27.     /// </para>
  28.     /// </devdoc>
  29.     [ClassInterface(ClassInterfaceType.AutoDispatch), ComVisible(true), Serializable()]
  30.     public class CodeRemoveEventStatement : CodeStatement
  31.     {
  32.         private CodeEventReferenceExpression eventRef;
  33.         private CodeExpression listener;
  34.        
  35.         /// <devdoc>
  36.         /// <para>
  37.         /// Initializes a new instance of <see cref='System.CodeDom.CodeRemoveEventStatement'/>.
  38.         /// </para>
  39.         /// </devdoc>
  40.         public CodeRemoveEventStatement()
  41.         {
  42.         }
  43.        
  44.         /// <devdoc>
  45.         /// <para>
  46.         /// Initializes a new instance of the <see cref='System.CodeDom.CodeRemoveEventStatement'/> class using the specified arguments.
  47.         /// </para>
  48.         /// </devdoc>
  49.         public CodeRemoveEventStatement(CodeEventReferenceExpression eventRef, CodeExpression listener)
  50.         {
  51.             this.eventRef = eventRef;
  52.             this.listener = listener;
  53.         }
  54.        
  55.         /// <devdoc>
  56.         /// <para>[To be supplied.]</para>
  57.         /// </devdoc>
  58.         public CodeRemoveEventStatement(CodeExpression targetObject, string eventName, CodeExpression listener)
  59.         {
  60.             this.eventRef = new CodeEventReferenceExpression(targetObject, eventName);
  61.             this.listener = listener;
  62.         }
  63.        
  64.         /// <devdoc>
  65.         /// <para>[To be supplied.]</para>
  66.         /// </devdoc>
  67.         public CodeEventReferenceExpression Event {
  68.             get {
  69.                 if (eventRef == null) {
  70.                     eventRef = new CodeEventReferenceExpression();
  71.                 }
  72.                 return eventRef;
  73.             }
  74.             set { eventRef = value; }
  75.         }
  76.        
  77.         /// <devdoc>
  78.         /// <para>
  79.         /// The listener.
  80.         /// </para>
  81.         /// </devdoc>
  82.         public CodeExpression Listener {
  83.             get { return listener; }
  84.             set { listener = value; }
  85.         }
  86.     }
  87. }

Developer Fusion