gxc
2019-11-15 aa3d6459c82a97f8f6f504d8a678814fc1089ab5
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();
        }
    }
}