home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / ClsView / MCEventInfo.cs < prev    next >
Encoding:
Text File  |  2000-06-23  |  2.0 KB  |  76 lines

  1. /*=====================================================================
  2.   File:      MCEventInfo.cs
  3.  
  4.   Summary:   Brief summary of the file contents and purpose.
  5.  
  6. ---------------------------------------------------------------------
  7.   This file is part of the Microsoft NGWS SDK Code Samples.
  8.  
  9.   Copyright (C) 2000 Microsoft Corporation.  All rights reserved.
  10.  
  11. This source code is intended only as a supplement to Microsoft
  12. Development Tools and/or on-line documentation.  See these other
  13. materials for detailed information regarding Microsoft code samples.
  14.  
  15. THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  16. KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  17. IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  18. PARTICULAR PURPOSE.
  19. =====================================================================*/
  20.  
  21. namespace LangUtil {
  22.  
  23. using System;
  24. using System.Reflection;
  25. using System.Collections;
  26.  
  27.    public class MCEventInfo : LangMember
  28.    {
  29.       internal String m_Name = String.Empty;
  30.       internal EventInfo m_ThisEventInfo = null;
  31.  
  32.       public MCEventInfo( EventInfo myEvent )
  33.       {
  34.          if ( myEvent == null )
  35.          throw new NullReferenceException( "The EventInfo passed to the constructor is null." );
  36.  
  37.          // Determine method name and return type
  38.        
  39.          m_Name = myEvent.Name;
  40.          m_ThisEventInfo = myEvent;      
  41.       }
  42.    
  43.       public Type ThisType
  44.       {
  45.          override get
  46.          {
  47.             return m_ThisEventInfo.ReflectedType;
  48.          }
  49.       }
  50.  
  51.       public string Attributes
  52.       {
  53.          override get
  54.          {
  55.             throw new NotSupportedException( "Attributes has not yet been implemented." );
  56.          }
  57.       }
  58.  
  59.       public EventInfo ThisEventInfo
  60.       {
  61.          get { return m_ThisEventInfo; }
  62.       }
  63.  
  64.        public override bool IsEvent()
  65.        {
  66.          return true;
  67.        }
  68.  
  69.       public String Name
  70.       {
  71.          override get { return m_Name; }
  72.       }
  73.    }
  74.  
  75. }  // namespace LangUtil
  76.