コード例 #1
0
        private static bool InvalidBeamAgendaReferenceSlide(PowerPointSlide refSlide)
        {
            var beamShape = FindBeamShape(refSlide);

            if (beamShape == null)
            {
                return(true);
            }
            try
            {
                if (BeamFormats.GetShapeWithPurpose(beamShape, ShapePurpose.BeamShapeHighlightedText) == null)
                {
                    return(true);
                }
                if (BeamFormats.GetShapeWithPurpose(beamShape, ShapePurpose.BeamShapeText) == null)
                {
                    return(true);
                }
            }
            catch (COMException)
            {
                // beam shape is not a group
                return(true);
            }
            return(false);
        }
コード例 #2
0
        private static void UpdateBeamReferenceSlide(PowerPointSlide refSlide)
        {
            var beamShape       = FindBeamShape(refSlide);
            var currentSections = ExtractAgendaSectionsFromBeam(beamShape);
            var newSections     = GetAllButFirstSection();

            var beamFormats        = BeamFormats.ExtractFormats(beamShape);
            var oldTextBoxes       = BeamFormats.GetAllShapesWithPurpose(beamShape, ShapePurpose.BeamShapeText);
            var highlightedTextBox = BeamFormats.GetShapeWithPurpose(beamShape, ShapePurpose.BeamShapeHighlightedText);
            var background         = BeamFormats.GetShapeWithPurpose(beamShape, ShapePurpose.BeamShapeBackground);

            MatchColour(highlightedTextBox, background);

            if (SectionsMatch(currentSections, newSections))
            {
                return;
            }


            var confirmResult = MessageBox.Show(new Form()
            {
                TopMost = true
            },
                                                TextCollection.AgendaLabReorganiseSidebarContent,
                                                TextCollection.AgendaLabReorganiseSidebarTitle,
                                                MessageBoxButtons.YesNo);

            if (confirmResult == DialogResult.Yes)
            {
                ReorganiseBeam(refSlide, newSections, highlightedTextBox, background, beamFormats, oldTextBoxes, beamShape);
            }
            else
            {
                UpdateBeamItems(refSlide, newSections, highlightedTextBox, background, beamFormats, oldTextBoxes, beamShape);
            }
        }