本文整理汇总了C#中Slide.Any方法的典型用法代码示例。如果您正苦于以下问题:C# Slide.Any方法的具体用法?C# Slide.Any怎么用?C# Slide.Any使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Slide
的用法示例。
在下文中一共展示了Slide.Any方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Merge
protected Presentation Merge(UserIdentity identity,
PresentationInfo presentationInfo,
Slide[] newSlideArr,
Presentation presentationStored,
out LockingInfo[] lockedSlides,
out Slide[] slideAlreadyExists)
{
IEnumerable<Slide> existedSlides = presentationStored.SlideList.Where(
sl => newSlideArr.Any(newsl=>newsl.Id == sl.Id));
if (existedSlides.Count() != 0)
{
slideAlreadyExists = existedSlides.ToArray();
lockedSlides = new LockingInfo[] {};
return null;
}
foreach (Slide slide in newSlideArr)
{
//Slide slideStored = presentationStored.SlideList.Find(
// sl => sl.Id == slide.Id);
//if (slideStored != null) return null;
slide.State = SlideState.Normal;
presentationStored.SlideList.Add(slide);
}
// анализ удаленных слайдов
List<Slide> slideListDeleted = presentationStored.SlideList.FindAll(
sl => !presentationInfo.SlideInfoList.Exists(sli => sli.Id == sl.Id));
if (!IsStandAlone)
{
IEnumerable<LockingInfo> lockedSl = slideListDeleted.Select(
sl => _lockService.GetLockInfo(ObjectKeyCreator.CreateSlideKey(presentationInfo.UniqueName, sl.Id))).Where(
li=>li != null);
if (lockedSl.Count() != 0)
{
lockedSlides = lockedSl.ToArray();
slideAlreadyExists = new Slide[] {};
return null;
}
}
// удаляем слайды
presentationStored.SlideList.RemoveAll(slideListDeleted.Contains);
presentationStored.SavePresentationLevelChanges(presentationInfo);
slideAlreadyExists = new Slide[] { };
lockedSlides = new LockingInfo[] { };
return presentationStored;
}