IComparable

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO.Ports;
using DeviceMonitor.DBUtility;
using DeviceMonitor.RealData;
using System.Collections;
using System.Diagnostics;

namespace DeviceMonitor
{
    /// <summary>
    
/// 串口扩展类,继承SerialPort类
    
/// </summary>
    public class SerialPortExpand : SerialPort,IComparable
    {
        /// <summary>
        
/// 组件构造函数
        
/// </summary>
        public SerialPortExpand()
        {
        }
        /// <summary>
        
/// 实现IComparable接口
        
/// </summary>
        
/// <param name="obj"></param>
        
/// <returns></returns>
        public int CompareTo(object obj)
        {
            SerialPortExpand target = (SerialPortExpand)obj;

            return this.PortName.CompareTo(target.PortName);
        }
    }
}
posted on 2012-02-17 14:04  一路前行  阅读(323)  评论(0编辑  收藏  举报