本文整理汇总了C#中PowerPointLabs.Models.PowerPointSlide.GetShapesWithPrefix方法的典型用法代码示例。如果您正苦于以下问题:C# PowerPointSlide.GetShapesWithPrefix方法的具体用法?C# PowerPointSlide.GetShapesWithPrefix怎么用?C# PowerPointSlide.GetShapesWithPrefix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PowerPointLabs.Models.PowerPointSlide
的用法示例。
在下文中一共展示了PowerPointSlide.GetShapesWithPrefix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrepareForZoomToArea
private void PrepareForZoomToArea(PowerPointSlide slideToPanFrom, PowerPointSlide slideToPanTo)
{
//Delete all shapes from slide excpet last magnified shape
List<PowerPoint.Shape> shapes = _slide.Shapes.Cast<PowerPoint.Shape>().ToList();
var matchingShapes = shapes.Where(current => (!current.Name.Contains("PPTLabsMagnifyAreaGroup")));
foreach (PowerPoint.Shape s in matchingShapes)
s.Delete();
panShapeFrom = GetShapesWithPrefix("PPTLabsMagnifyAreaGroup")[0];
panShapeTo = slideToPanTo.GetShapesWithPrefix("PPTLabsMagnifyAreaGroup")[0];
//Add fade animation to existing shapes
shapes = _slide.Shapes.Cast<PowerPoint.Shape>().ToList();
matchingShapes = shapes.Where(current => (!(current.Equals(indicatorShape) || current.Equals(panShapeFrom))));
foreach (PowerPoint.Shape s in matchingShapes)
{
DeleteShapeAnimations(s);
PowerPoint.Effect effectFade = _slide.TimeLine.MainSequence.AddEffect(s, PowerPoint.MsoAnimEffect.msoAnimEffectFade, PowerPoint.MsoAnimateByLevel.msoAnimateLevelNone, PowerPoint.MsoAnimTriggerType.msoAnimTriggerWithPrevious);
effectFade.Exit = Office.MsoTriState.msoTrue;
effectFade.Timing.Duration = 0.25f;
}
DeleteSlideNotes();
DeleteSlideMedia();
ManageSlideTransitions();
indicatorShape = AddPowerPointLabsIndicator();
}
示例2: LoadStyleAndImage
/// <summary>
///
/// </summary>
/// <param name="targetSlide"></param>
/// <param name="isLoadingWithDefaultPicture">when no style found, use default picture to preview style</param>
/// <returns>is successfully loaded</returns>
private bool LoadStyleAndImage(PowerPointSlide targetSlide, bool isLoadingWithDefaultPicture = true)
{
if (targetSlide == null) return false;
var isSuccessfullyLoaded = false;
var originalShapeList = targetSlide
.GetShapesWithPrefix(ShapeNamePrefix + "_" + EffectName.Original_DO_NOT_REMOVE);
var croppedShapeList = targetSlide
.GetShapesWithPrefix(ShapeNamePrefix + "_" + EffectName.Cropped_DO_NOT_REMOVE);
// if no original shape, show default picture
if (originalShapeList.Count == 0 && isLoadingWithDefaultPicture)
{
// De-select the picture
EnterDefaultPictureMode();
UpdatePreviewImages(isEnteringPictureVariation: true);
UpdatePreviewStageControls();
isSuccessfullyLoaded = true;
}
else if (originalShapeList.Count > 0) // load the style
{
Logger.Log("Original shapes found.");
var originalImageShape = originalShapeList[0];
var isImageStillInListBox = false;
var styleName = originalImageShape.Tags[Service.Effect.Tag.ReloadPrefix + "StyleName"];
// if the image source is still in the listbox,
// select it as source and also select the target style
for (var i = 0; i < ImageSelectionListBox.Items.Count; i++)
{
var imageItem = (ImageItem)ImageSelectionListBox.Items[i];
if (imageItem.FullSizeImageFile == originalImageShape.Tags[Service.Effect.Tag.ReloadOriginImg]
|| imageItem.ContextLink == originalImageShape.Tags[Service.Effect.Tag.ReloadImgContext])
{
isImageStillInListBox = true;
UpdatePictureDimensionsInfo(croppedShapeList, originalImageShape, imageItem);
ImageSelectionListBox.SelectedIndex = i;
// previewing is done async, need to use beginInvoke
// so that it's after previewing
OpenVariationFlyoutForReload(styleName, originalImageShape);
break;
}
}
// if image source is deleted already, need to re-generate images
// and put into listbox
if (!isImageStillInListBox)
{
var imageItem = ExtractImageItem(originalImageShape, croppedShapeList);
ViewModel.ImageSelectionList.Add(imageItem);
ImageSelectionListBox.SelectedIndex = ImageSelectionListBox.Items.Count - 1;
OpenVariationFlyoutForReload(styleName, originalImageShape);
}
isSuccessfullyLoaded = true;
}
return isSuccessfullyLoaded;
}