using System; using System.Collections.Generic; namespace GeologyToolkit { internal class Borehole { public string Coord => $"({X},{Y})"; public double Elev { get; set; } public double X { get; set; } public double Y { get; set; } public List SoilLayers { get; set; } = new(); /// /// 钻孔类型 /// public string BoreholeType { get; set; } /// /// 稳定水位 /// public string StableWaterLine { get; set; } /// /// 稳定水位观测日期 /// public string StableWaterLineDate { get; set; } /// /// 初见水位 /// public string MeetWaterLine { get; set; } /// /// 初见水位观测日期 /// public string MeetWaterLineDate { get; set; } /// /// 开工日期 /// public string StartWorkDate { get; set; } /// /// 竣工日期 /// public string EndWorkDate { get; set; } /// /// 勘探深度 /// public string Depth { get; set; } /// /// 钻孔编号 /// public string BoreholeNum { get; set; } public override bool Equals(object obj) { if (obj == null) //步骤1 return false; if (GetType() != obj.GetType()) //步骤3 return false; if (ReferenceEquals(this, obj)) return true; if (BoreholeNum == ((Borehole)obj).BoreholeNum) { return true; } return Equals((Borehole)obj); //步骤4 //return base.Equals(obj); } public override int GetHashCode() { return BoreholeNum != null ? StringComparer.InvariantCulture.GetHashCode(BoreholeNum) : 0; } } }