/// <summary> /// Determines whether the specified object is equal to the current object. /// </summary> /// <param name="obj">The object to compare with the current object.</param> /// <returns>true if the specified object is equal to the current object; otherwise, false.</returns> public override bool Equals(object obj) { Finding other = obj as Finding; if ((object)other == null) { return(false); } return(this.Author == other.Author && this.Background == other.Background && this.Description == other.Description && this.Name == other.Name && this.PossibleSolution == other.PossibleSolution && this.Severity == other.Severity && this.IsVisible == other.IsVisible && this.Violations.SequenceEqual(other.Violations)); }
public GroupViolation(XElement root, Workbook workbook, Finding finding) : base(root, workbook, finding) { (from p in root.Elements(XName.Get("singleviolation")) select new SingleViolation(p, workbook, finding)).ToList().ForEach(p => this.Violations.Add(p)); this.VisibilityChanged += GroupViolation_VisibilityChanged; }
public Violation(XElement root, Workbook workbook, Finding finding) { this.Finding = finding; //this.Id = Convert.ToInt32(root.Attribute(XName.Get("number")).Value); this.CausingElement = root.Attribute(XName.Get("causingelement")).Value; this.Description = root.Attribute(XName.Get("description")).Value; var location = root.Attribute(XName.Get("location")).Value; if (!string.IsNullOrWhiteSpace(location)) { // Split the location string into its components // Input might be: [example.xlsx]Sheet1!B12 location = location.Substring(location.IndexOf(']') + 1); this.Cell = new CellLocation(workbook, location); } this.IsVisible = true; }
public SingleViolation(XElement root, Workbook workbook, Finding finding) : base(root, workbook, finding) { this.Severity = decimal.Parse(root.Attribute(XName.Get("severity")).Value.Replace(".0", "")); this.VisibilityChanged += SingleViolation_VisibilityChanged; }