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);
}
}
}
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);
}
}
}