示例#1
0
		private void FindDifferences()
		{
			var originalSlidesIds = OriginalCourse.Slides.Select(s => s.Id).ToImmutableHashSet();
			var changedSlidesIds = ChangedCourse.Slides.Select(s => s.Id).ToImmutableHashSet();
			foreach (var slide in OriginalCourse.Slides)
			{
				if (!changedSlidesIds.Contains(slide.Id))
					RemovedSlides.Add(slide);
				else
				{
					var slideDiff = new SlideDiff(slide, ChangedCourse.GetSlideById(slide.Id));
					if (!slideDiff.IsEmptyChangeset)
						SlideDiffs.Add(slideDiff);
				}
			}

			InsertedSlides.AddRange(ChangedCourse.Slides.Where(slide => !originalSlidesIds.Contains(slide.Id)));
		}
示例#2
0
        private void FindDifferences()
        {
            var originalSlidesIds = OriginalCourse.Slides.Select(s => s.Id).ToImmutableHashSet();
            var changedSlidesIds  = ChangedCourse.Slides.Select(s => s.Id).ToImmutableHashSet();

            foreach (var slide in OriginalCourse.Slides)
            {
                if (!changedSlidesIds.Contains(slide.Id))
                {
                    RemovedSlides.Add(slide);
                }
                else
                {
                    var slideDiff = new SlideDiff(slide, ChangedCourse.GetSlideById(slide.Id));
                    if (!slideDiff.IsEmptyChangeset)
                    {
                        SlideDiffs.Add(slideDiff);
                    }
                }
            }

            InsertedSlides.AddRange(ChangedCourse.Slides.Where(slide => !originalSlidesIds.Contains(slide.Id)));
        }