private int GetNextId() { int currentSampleAttachmentsIndex = ListSampleAttachmentses.FindIndex(x => x.SampleAttachmentID == CurrentId); if (currentSampleAttachmentsIndex + 1 == ListSampleAttachmentses.Count) { currentSampleAttachmentsIndex = -1; } return(ListSampleAttachmentses[currentSampleAttachmentsIndex + 1].SampleAttachmentID); }
private int GetPrevId() { int currentSampleAttachmentsIndex = ListSampleAttachmentses.FindIndex(x => x.SampleAttachmentID == CurrentId); if (currentSampleAttachmentsIndex == 0) { currentSampleAttachmentsIndex = ListSampleAttachmentses.Count; } return(ListSampleAttachmentses[currentSampleAttachmentsIndex - 1].SampleAttachmentID); }