黄学彪
2019-11-25 5727cf0b9b54da0a191dd1e23cb5abf21320fbff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
using System.Collections.Generic;
 
namespace Shared.Common
{
    public class CompareDeviceUI : IEqualityComparer<DeviceUI>
    {
        public bool Equals(DeviceUI x, DeviceUI y)
        {
           if(x.CommonDevice.DeviceAddr==y.CommonDevice.DeviceAddr && x.CommonDevice.DeviceEpoint==y.CommonDevice.DeviceEpoint)
            {
                return true;
            }
            return false;
        }
 
        public int GetHashCode(DeviceUI obj)
        {
            if(obj ==null)
            {
                return 0;
            }
            return obj.ToString().GetHashCode();
        }
    }
}