public IDataBlock Build() { PreConditions.Operation().IsInvalidIf((Detectors == null || Detectors.Count() == 0), "Detector was not set") .And.IsInvalidIf((InputFile == null), "InputFile was not set") .And.IsInvalidIf(((StartOffset < 0) || (StartOffset >= InputFile.Length)), "StartOffset is invalid") .And.IsInvalidIf(((EndOffset <= StartOffset) /*|| (EndOffset > InputFile.Length)*/), "EndOffset is invalid"); return(new DataBlock(this)); }
public bool Equals(DataBlock other) { if (other == null) { return(false); } if (other == this) { return(true); } if (other.DataFormat != DataFormat) { return(false); } if (!other.Detectors.Count().Equals(Detectors.Count())) { return(false); } for (int i = 0; i < other.Detectors.Count(); i++) { if (!other.Detectors.ElementAt(i).Equals(Detectors.ElementAt(i))) { return(false); } } if (!other.InputFile.Equals(InputFile)) { return(false); } if (other.StartOffset != StartOffset) { return(false); } if (other.EndOffset != EndOffset) { return(false); } if (other.IsFullFile != IsFullFile) { return(false); } if (!Equals(other.ReferenceHeader, ReferenceHeader)) { return(false); } if (!other.CodecStreams.SequenceEqual(other.CodecStreams)) { return(false); } return(true); }