当前位置: 首页>>代码示例>>C#>>正文


C# PowerPointSlide.GetShapesWithPrefix方法代码示例

本文整理汇总了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();
        }
开发者ID:suheti,项目名称:powerpointlabs,代码行数:27,代码来源:PowerPointMagnifiedPanSlide.cs

示例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;
        }
开发者ID:nus-fboa2016-PL,项目名称:PowerPointLabs,代码行数:65,代码来源:PictureSlidesLabWindow.xaml.LoadStyle.cs


注:本文中的PowerPointLabs.Models.PowerPointSlide.GetShapesWithPrefix方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。