Ejemplo n.º 1
0
        public static void GenerateAgenda(Type type)
        {
            bool dialogOpen = false;
            var currentWindow = Globals.ThisAddIn.Application.ActiveWindow;
            var oldViewType = currentWindow.ViewType;

            try
            {
                var slideTracker = new SlideSelectionTracker(SelectedSlides, CurrentSlide);

                if (AgendaPresent())
                {
                    var confirm = MessageBox.Show(TextCollection.AgendaLabAgendaExistError,
                                                  TextCollection.AgendaLabAgendaExistErrorCaption,
                                                  MessageBoxButtons.OKCancel);
                    if (confirm != DialogResult.OK) return;

                    RemoveAllAgendaItems(slideTracker);
                }

                if (!ValidSections()) return;

                // The process should not abort (return) anytime past this point. Changes will start being made past this point.

                slideTracker.DeleteAcknowledgementSlideAndTrack();

                dialogOpen = DisplayLoadingDialog(TextCollection.AgendaLabGeneratingDialogTitle,
                                                    TextCollection.AgendaLabGeneratingDialogContent);
                currentWindow.ViewType = PpViewType.ppViewNormal;

                switch (type)
                {
                    case Type.Beam:
                        CreateBeamAgenda(slideTracker);
                        break;
                    case Type.Bullet:
                        CreateBulletAgenda(slideTracker);
                        break;
                    case Type.Visual:
                        CreateVisualAgenda(slideTracker);
                        break;
                }

                PowerPointPresentation.Current.AddAckSlide();
                SelectOriginalSlide(slideTracker.UserCurrentSlide, PowerPointPresentation.Current.FirstSlide);
            }
            finally
            {
                if (dialogOpen)
                {
                    DisposeLoadingDialog();
                }
                currentWindow.ViewType = oldViewType;
            }
        }
Ejemplo n.º 2
0
        public static void GenerateAgenda(Type type)
        {
            bool dialogOpen    = false;
            var  currentWindow = Globals.ThisAddIn.Application.ActiveWindow;
            var  oldViewType   = currentWindow.ViewType;

            try
            {
                var slideTracker = new SlideSelectionTracker(SelectedSlides, CurrentSlide);

                if (AgendaPresent())
                {
                    var confirm = MessageBox.Show(TextCollection.AgendaLabAgendaExistError,
                                                  TextCollection.AgendaLabAgendaExistErrorCaption,
                                                  MessageBoxButtons.OKCancel);
                    if (confirm != DialogResult.OK)
                    {
                        return;
                    }

                    RemoveAllAgendaItems(slideTracker);
                }

                if (!ValidSections())
                {
                    return;
                }

                // The process should not abort (return) anytime past this point. Changes will start being made past this point.

                slideTracker.DeleteAcknowledgementSlideAndTrack();

                dialogOpen = DisplayLoadingDialog(TextCollection.AgendaLabGeneratingDialogTitle,
                                                  TextCollection.AgendaLabGeneratingDialogContent);
                currentWindow.ViewType = PpViewType.ppViewNormal;

                switch (type)
                {
                case Type.Beam:
                    CreateBeamAgenda(slideTracker);
                    break;

                case Type.Bullet:
                    CreateBulletAgenda(slideTracker);
                    break;

                case Type.Visual:
                    CreateVisualAgenda(slideTracker);
                    break;
                }

                PowerPointPresentation.Current.AddAckSlide();
                SelectOriginalSlide(slideTracker.UserCurrentSlide, PowerPointPresentation.Current.FirstSlide);
            }
            finally
            {
                if (dialogOpen)
                {
                    DisposeLoadingDialog();
                }
                currentWindow.ViewType = oldViewType;
            }
        }
Ejemplo n.º 3
0
        public static void SynchroniseAgenda()
        {
            bool dialogOpen    = false;
            var  currentWindow = Globals.ThisAddIn.Application.ActiveWindow;
            var  oldViewType   = currentWindow.ViewType;

            try
            {
                var  slideTracker           = new SlideSelectionTracker(SelectedSlides, CurrentSlide);
                var  refSlide               = FindReferenceSlide();
                var  type                   = GetReferenceSlideType();
                bool usingNewReferenceSlide = false;

                if (refSlide == null)
                {
                    type     = GetAnyAgendaSlideType();
                    refSlide = TryFindSuitableRefSlide(type);
                    usingNewReferenceSlide = true;
                }

                if (!ValidAgenda(refSlide, type))
                {
                    return;
                }
                if (!ValidSections())
                {
                    return;
                }

                // The process should not abort (return) anytime past this point. Changes will start being made past this point.

                if (usingNewReferenceSlide)
                {
                    SetAsReferenceSlide(refSlide, type);
                }

                slideTracker.DeleteAcknowledgementSlideAndTrack();
                dialogOpen = DisplayLoadingDialog(TextCollection.AgendaLabSynchronizingDialogTitle,
                                                  TextCollection.AgendaLabSynchronizingDialogContent);
                currentWindow.ViewType = PpViewType.ppViewNormal;

                BringToFront(refSlide);

                switch (type)
                {
                case Type.Beam:
                    SyncBeamAgenda(slideTracker, refSlide);
                    break;

                case Type.Bullet:
                    SyncBulletAgenda(slideTracker, refSlide);
                    break;

                case Type.Visual:
                    SyncVisualAgenda(slideTracker, refSlide);
                    break;
                }

                PowerPointPresentation.Current.AddAckSlide();
                SelectOriginalSlide(slideTracker.UserCurrentSlide, PowerPointPresentation.Current.FirstSlide);
            }
            finally
            {
                if (dialogOpen)
                {
                    DisposeLoadingDialog();
                }
                currentWindow.ViewType = oldViewType;
            }
        }
Ejemplo n.º 4
0
        public static void SynchroniseAgenda()
        {
            bool dialogOpen = false;
            var currentWindow = Globals.ThisAddIn.Application.ActiveWindow;
            var oldViewType = currentWindow.ViewType;

            try
            {
                var slideTracker = new SlideSelectionTracker(SelectedSlides, CurrentSlide);
                var refSlide = FindReferenceSlide();
                var type = GetReferenceSlideType();
                bool usingNewReferenceSlide = false;

                if (refSlide == null)
                {
                    type = GetAnyAgendaSlideType();
                    refSlide = TryFindSuitableRefSlide(type);
                    usingNewReferenceSlide = true;
                }

                if (!ValidAgenda(refSlide, type)) return;
                if (!ValidSections()) return;

                // The process should not abort (return) anytime past this point. Changes will start being made past this point.

                if (usingNewReferenceSlide)
                {
                    SetAsReferenceSlide(refSlide, type);
                }

                slideTracker.DeleteAcknowledgementSlideAndTrack();
                dialogOpen = DisplayLoadingDialog(TextCollection.AgendaLabSynchronizingDialogTitle,
                                                    TextCollection.AgendaLabSynchronizingDialogContent);
                currentWindow.ViewType = PpViewType.ppViewNormal;

                BringToFront(refSlide);

                switch (type)
                {
                    case Type.Beam:
                        SyncBeamAgenda(slideTracker, refSlide);
                        break;
                    case Type.Bullet:
                        SyncBulletAgenda(slideTracker, refSlide);
                        break;
                    case Type.Visual:
                        SyncVisualAgenda(slideTracker, refSlide);
                        break;
                }

                PowerPointPresentation.Current.AddAckSlide();
                SelectOriginalSlide(slideTracker.UserCurrentSlide, PowerPointPresentation.Current.FirstSlide);
            }
            finally
            {
                if (dialogOpen)
                {
                    DisposeLoadingDialog();
                }
                currentWindow.ViewType = oldViewType;
            }
        }