internal void RemoveFromSampleDetails(SampleDetail sampleDetail) { #if DEBUG if (!sampleDetails.Remove(sampleDetail)) { throw new Exception(); } #else sampleDetails.Remove(sampleDetail); #endif onRemovedFromSampleDetails(sampleDetail); #if DEBUG DC.Trace?.Invoke($"Remove SampleDetail {sampleDetail.GetKeyOrHash()} from " + $"{this.GetKeyOrHash()} Sample.SampleDetails"); #endif }
internal void AddToSampleDetails(SampleDetail sampleDetail) { #if DEBUG if (sampleDetail == SampleDetail.NoSampleDetail) { throw new Exception(); } if ((sampleDetail.Key >= 0) && (Key < 0)) { throw new Exception(); } if (sampleDetails.Contains(sampleDetail)) { throw new Exception(); } #endif sampleDetails.Add(sampleDetail); onAddedToSampleDetails(sampleDetail); #if DEBUG DC.Trace?.Invoke($"Add SampleDetail {sampleDetail.GetKeyOrHash()} to " + $"{this.GetKeyOrHash()} Sample.SampleDetails"); #endif }
/// <summary> /// Called after a sampleDetail gets removed from SampleDetails. /// </summary> partial void onRemovedFromSampleDetails(SampleDetail sampleDetail) { }
/// <summary> /// Called after a sampleDetail gets added to SampleDetails. /// </summary> partial void onAddedToSampleDetails(SampleDetail sampleDetail) { }