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

  1. /*=====================================================================
  2.   File:      NativeEventInfo.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 NativeEventInfo : LangMember
  28.    {
  29.       internal String m_Name = String.Empty;
  30.       internal EventInfo m_ThisEventInfo = null;
  31.  
  32.       public NativeEventInfo( 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.          m_Name = myEvent.Name;
  39.          m_ThisEventInfo = myEvent;
  40.       }
  41.    
  42.       public EventInfo ThisEventInfo
  43.       {
  44.          get { return m_ThisEventInfo; }
  45.       }
  46.  
  47.       public VisualBasicEventInfo VisualBasicLangObject
  48.       {
  49.          get { return new VisualBasicEventInfo( m_ThisEventInfo ); }
  50.       }
  51.  
  52.       public CSharpEventInfo CSharpLangObject
  53.       {
  54.          get { return new CSharpEventInfo( m_ThisEventInfo ); }
  55.       }
  56.  
  57.       public MCEventInfo MCLangObject
  58.       {
  59.          get { return new MCEventInfo( m_ThisEventInfo ); }
  60.       }
  61.  
  62.       public override bool IsEvent()
  63.       {
  64.          return true;
  65.       }
  66.  
  67.       public String Name
  68.       {
  69.          override get { return m_Name; }
  70.       }
  71.  
  72.       public Type ThisType
  73.       {
  74.          override get { return m_ThisEventInfo.ReflectedType; }
  75.       }
  76.  
  77.       public string Attributes
  78.       {
  79.          override get { throw new NotSupportedException( "Attributes is not yet implemented on this class." ); }
  80.       }
  81.    }
  82.  
  83. } // namespace LangUtil
  84.