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

  1. /*=====================================================================
  2.   File:      Comparers.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 TypeComparer : IComparer 
  28.    {
  29.       public int Compare( Object First, Object Second ) 
  30.       {
  31.          return ( String.Compare( ((Type)First).FullName, ((Type)Second).FullName ) );
  32.       }
  33.    }
  34.  
  35.    public class EventComparer : IComparer
  36.    {
  37.       public int Compare( Object First, Object Second )
  38.       {
  39.          return ( String.Compare( ((EventInfo)First).Name, ((EventInfo)Second).Name ) );
  40.       }
  41.    }
  42.  
  43.    public class MethodComparer : IComparer
  44.    {
  45.       public int Compare( Object First, Object Second )
  46.       {
  47.          return ( String.Compare( ((MethodInfo)First).Name, ((MethodInfo)Second).Name ) );
  48.       }
  49.    }
  50.  
  51.    public class PropertyComparer : IComparer
  52.    {
  53.       public int Compare( Object First, Object Second ) 
  54.       {
  55.          return ( String.Compare( ((PropertyInfo)First).Name, ((PropertyInfo)Second).Name ) );
  56.       }
  57.    }
  58.  
  59.    public class FieldComparer : IComparer 
  60.    {
  61.       public int Compare( Object First, Object Second ) 
  62.       {
  63.          return ( String.Compare( ((FieldInfo)First).Name, ((FieldInfo)Second).Name ) );
  64.       }
  65.    }
  66.  
  67.    public class ConstructorComparer : IComparer
  68.    {
  69.       public int Compare( Object First, Object Second ) 
  70.       {
  71.          return ( String.Compare( ((ConstructorInfo)First).Name, ((ConstructorInfo)Second).Name ) );
  72.       }
  73.    }
  74.  
  75. } // namespace LangUtil
  76.