예제 #1
0
        IEnumerable<IBasicShape> IBar.Render(int currentPosition, PresentationInfo presentationInfo)
        {
            List<IBasicShape> shapes = new List<IBasicShape>();
            int slidesCount = presentationInfo.SlidesCount;

            if (presentationInfo.DisableOnFirstSlide && currentPosition == 1)
            {
                return shapes;
            }

            if (presentationInfo.DisableOnFirstSlide)
            {
                currentPosition -= 1;
                slidesCount -= 1;
            }

            for (int i = 0; i < slidesCount; i++)
            {
                IBasicShape shape = new BasicShape();
                shape.Height = shape.Width = presentationInfo.UserSize;

                if (_positionOptions.Top.Selected)
                {
                    shape.Top = _gap;
                }
                else
                {
                    shape.Top = presentationInfo.Height - presentationInfo.UserSize - _gap;
                }

                shape.Left = _gap + (i*(presentationInfo.UserSize + _gap));

                if (_positionOptions.Right.Selected)
                {
                    float leftConstant = slidesCount*presentationInfo.UserSize;
                    leftConstant = presentationInfo.Width - leftConstant - (slidesCount*_gap) - _gap;

                    // Add constant to left margin
                    shape.Left = leftConstant + shape.Left;
                }

                shape.Type = MsoAutoShapeType.msoShapeRectangle;

                // Slides are NOT indexed from 0!
                if ((i + 1) == currentPosition)
                {
                    shape.ColorType = ShapeType.Active;
                }
                else
                {
                    shape.ColorType = ShapeType.Inactive;
                }

                shapes.Add(shape);
            }

            return shapes;
        }
예제 #2
0
        IEnumerable<IBasicShape> IBar.Render(int currentPosition, PresentationInfo presentationInfo)
        {
            _presentationInfo = presentationInfo;

            List<IBasicShape> shapes = new List<IBasicShape>();

            if (presentationInfo.DisableOnFirstSlide && currentPosition == 1)
            {
                return shapes;
            }

            shapes.Add(MakeBackground());
            shapes.Add(MakeProgressBar(currentPosition));

            if (_positionInfo.Bottom.Selected)
            {
                foreach (IBasicShape basicShape in shapes)
                {
                    basicShape.Top = presentationInfo.Height - presentationInfo.UserSize;
                }
            }

            return shapes;
        }
        private PresentationInfo CreateInfo(IEnumerable<Slide> visibleSlides)
        {
            var presentationInfo = new PresentationInfo
            {
                Height = _powerpointAdapter.PresentationHeight(),
                Width = _powerpointAdapter.PresentationWidth(),
                SlidesCount = visibleSlides.Count(),
                UserSize = BarSize(),
                DisableOnFirstSlide = checkBox1.Checked
            };

            return presentationInfo;
        }
예제 #4
0
        private IBasicShape MakeShapeStub(PresentationInfo presentation)
        {
            IBasicShape shapeStub = new BasicShape();

            shapeStub.Height = presentation.UserSize;

            shapeStub.Top = 0;
            shapeStub.Left = 0;
            shapeStub.Type = MsoAutoShapeType.msoShapeRectangle;

            return shapeStub;
        }