Example #1
0
        private int GetNextId()
        {
            int currentSampleAttachmentsIndex = ListSampleAttachmentses.FindIndex(x => x.SampleAttachmentID == CurrentId);

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

            if (currentSampleAttachmentsIndex == 0)
            {
                currentSampleAttachmentsIndex = ListSampleAttachmentses.Count;
            }
            return(ListSampleAttachmentses[currentSampleAttachmentsIndex - 1].SampleAttachmentID);
        }