home *** CD-ROM | disk | FTP | other *** search
- /*=====================================================================
- File: Comparers.cs
-
- Summary: Brief summary of the file contents and purpose.
-
- ---------------------------------------------------------------------
- This file is part of the Microsoft NGWS SDK Code Samples.
-
- Copyright (C) 2000 Microsoft Corporation. All rights reserved.
-
- This source code is intended only as a supplement to Microsoft
- Development Tools and/or on-line documentation. See these other
- materials for detailed information regarding Microsoft code samples.
-
- THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
- KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
- PARTICULAR PURPOSE.
- =====================================================================*/
-
- namespace LangUtil {
-
- using System;
- using System.Reflection;
- using System.Collections;
-
- public class TypeComparer : IComparer
- {
- public int Compare( Object First, Object Second )
- {
- return ( String.Compare( ((Type)First).FullName, ((Type)Second).FullName ) );
- }
- }
-
- public class EventComparer : IComparer
- {
- public int Compare( Object First, Object Second )
- {
- return ( String.Compare( ((EventInfo)First).Name, ((EventInfo)Second).Name ) );
- }
- }
-
- public class MethodComparer : IComparer
- {
- public int Compare( Object First, Object Second )
- {
- return ( String.Compare( ((MethodInfo)First).Name, ((MethodInfo)Second).Name ) );
- }
- }
-
- public class PropertyComparer : IComparer
- {
- public int Compare( Object First, Object Second )
- {
- return ( String.Compare( ((PropertyInfo)First).Name, ((PropertyInfo)Second).Name ) );
- }
- }
-
- public class FieldComparer : IComparer
- {
- public int Compare( Object First, Object Second )
- {
- return ( String.Compare( ((FieldInfo)First).Name, ((FieldInfo)Second).Name ) );
- }
- }
-
- public class ConstructorComparer : IComparer
- {
- public int Compare( Object First, Object Second )
- {
- return ( String.Compare( ((ConstructorInfo)First).Name, ((ConstructorInfo)Second).Name ) );
- }
- }
-
- } // namespace LangUtil
-