示例#1
0
 public void SelectSlideViewFromControl(SlideView slideView)
 {
     if (slideView != null && m_PlayerController != null && m_PlayerController.SlideHistory.Peek() != slideView.Slide)
     {
         if (m_PlayerController.PlaySlide(PresentationController.Instance.Presentation, slideView.Slide))
             PresentationController.Instance.SendPlaySelectionChanged(slideView.Slide);
     }
     SelectSlideView(slideView);
 }
示例#2
0
        /// <summary>
        /// Изменяет свойства сцены (Форма "Свойства")
        /// </summary>
        /// <param name="CurrentSlideView">Отображение сцены для изменения</param>
        /// <param name="Slide">Содержит требуемые изменения</param>
        /// <param name="NewDefLink">Новая ссылка по умолчанию</param>
        /// <param name="OldDefLink">Старая ссылка по умолчанию</param>
        /// <param name="IsStartup">True, если сцена - стартовая для сценария</param>
        internal void ChangeSlideData(SlideView CurrentSlideView, Slide Slide, SlideLink NewDefLink, bool IsStartup)
        {
            Model.HistoryManager.StartAtomicAction(CommandDescr.EditSlideDescr);
            Slide.Modified = DateTime.Now;
            string authorName = identity.User.FullName;
            if (String.IsNullOrEmpty(authorName))
                authorName = identity.User.Name;
            Slide.Author = authorName;
            Model.HistoryManager.RecordPropertyChanged(CurrentSlideView, String.Empty, "Slide");
            Slide.CopyTo(CurrentSlideView.Slide);

            if (NewDefLink != null)
            {
                RefreshDefaultLinkForSlide(CurrentSlideView, NewDefLink);
                foreach (var link in CurrentSlideView.GetOutgoingLinks().Except(new[] { NewDefLink }))
                {
                    Model.HistoryManager.RecordPropertyChanged(link, String.Empty, "IsDefault");
                    link.IsDefault = false;
                }
            }

            bool updateStartup = false;
            if (IsStartup)
            {
                Model.HistoryManager.RecordPropertyChanged(this, String.Empty, "m_startSlideId");
                StartSlide = CurrentSlideView;
                updateStartup = true;
            }
            else
            {
                if (StartSlide.Slide.Id == CurrentSlideView.Slide.Id && SlideCount > 1)
                {
                    Model.HistoryManager.RecordPropertyChanged(this, String.Empty, "m_startSlideId");
                    StartSlide = Model.Nodes.OfType<SlideView>().Except(new[] { CurrentSlideView }).First();
                    updateStartup = true;
                }
            }

            RefreshDefaultSlidePath(false);
            Model.HistoryManager.EndAtomicAction();

            if (updateStartup) UpdateStartSlide();
        }
示例#3
0
 private void UnlockSlide(SlideView slideView)
 {
     if (PresentationController.Instance.UnlockSlide(slideView.Slide))
     {
         slideView.Slide.State = SlideState.Normal;
         slideView.Unlock();
     }
 }
示例#4
0
        /// <summary>
        /// Устанавливает в состояние "Выбрана" заданную сцену
        /// </summary>
        /// <param name="slideView">Отображение сцены, которую нужно выбрать</param>
        public void SelectSlideView(SlideView slideView)
        {
            if (slideView != null)
            {
                SelectionList.Clear();
                SelectionList.Add(slideView);

                EnsureVisible(new PointF(slideView.BoundingRectangle.Left, slideView.BoundingRectangle.Bottom));
                CheckSelection();
            }
        }
示例#5
0
        internal void MakeDefaultLinksFor(SlideView view)
        {
            Model.HistoryManager.StartAtomicAction(CommandDescr.UpdateDefLinkDescr);
            view.GetIncomingSlideLinks().ForEach(l =>
                {
                    Model.HistoryManager.RecordPropertyChanged(l, String.Empty, "IsDefault");
                    l.IsDefault = true;

                    //set other links undefault
                    l.FromSlideView.GetOutgoingLinks().ForEach(link =>
                    {
                        if (link != l)
                        {
                            Model.HistoryManager.RecordPropertyChanged(link, String.Empty, "IsDefault");
                            link.IsDefault = false;
                        }
                    });

                });

            Model.HistoryManager.EndAtomicAction();
            RefreshDefaultSlidePath(true);
        }
示例#6
0
 SlideView AddSlideView(Slide slide, PointF pos)
 {
     SlideView child = new SlideView(slide, pos);
     this.Model.AppendChild(child);
     return child;
 }
示例#7
0
 /// <summary>
 /// Called, when user creates link via "link tool"
 /// </summary>
 public bool CanCreateLink(SlideView slide1, SlideView slide2)
 {
     bool exists = false;
     exists = slide1.GetAllLinks().Any(l => l.ToSlideView == slide2 | l.FromSlideView == slide2);
     return !exists;
 }
示例#8
0
        void CreateLinkInternal(SlideView FromSlideView, SlideView ToSlideView)
        {
            this.Model.BeginUpdate();
            SlideLink link = new SlideLink(PointF.Empty, PointF.Empty);
            FromSlideView.CentralPort.TryConnect(link.TailEndPoint);
            ToSlideView.CentralPort.TryConnect(link.HeadEndPoint);
            this.Model.AppendChild(link);
            link.IsDefault = FromSlideView.GetOutgoingLinks().Count == 1;
            this.Model.EndUpdate();

            RefreshDefaultSlidePath(true);
        }
示例#9
0
        /// <summary>
        /// Выбирает для сцены исходящий переход по умолчанию
        /// </summary>
        /// <param name="slide">сцена</param>
        public void RefreshDefaultLinkForSlide(SlideView view)
        {
            if (view == null) return;

            List<SlideLink> links = view.GetOutgoingLinks();
            if (links.Count > 0)
            {
                SlideLink link;
                List<SlideLink> lnks = links.Where(lnk => lnk.IsDefault).ToList();
                if (lnks.Count > 0)
                    link = lnks[0];
                else
                    link = links.First();
                RefreshDefaultLinkForSlide(view, link);
            }
        }
示例#10
0
 public void RefreshDefaultLinkForSlide(SlideView view, SlideLink link)
 {
     List<SlideLink> links = view.GetOutgoingLinks();
     if (links.Count > 0)
     {
         Model.HistoryManager.RecordPropertyChanged(link, String.Empty, "IsDefault");
         link.IsDefault = true;
     }
 }
示例#11
0
        /// <summary>
        /// Создает отображение сцены в указанной позиции
        /// </summary>
        /// <param name="slide">сцена</param>
        /// <param name="pos">Позиция</param>
        /// <returns>Отображение сцены</returns>
        public SlideView CreateSlideView(Slide slide, PointF pos)
        {
            this.SelectionList.Clear();

            //calc estimated document width
            float width = pos.X + SlideView.MaxWidth + SlideView.Margin;
            if (width > this.Model.DocumentSize.Width)
                this.Model.DocumentSize.Width = width;

            SlideView child = new SlideView(slide, pos);
            this.Model.AppendChild(child);

            return child;
        }
示例#12
0
        public bool IsLabelUnique(int labelID, SlideView exceptOne)
        {
            foreach (SlideView sw in slideViews())
            {
                if (sw == exceptOne)
                    continue;

                if (sw.Slide.LabelId == labelID && labelID != -1)
                    return false;
            }

            return true;
        }
示例#13
0
        public SlidePropertiesForm(SlideGraphController AController)
        {
            InitializeComponent();
            m_controller = AController;
            CurrentSlideView = m_controller.SelectedSlideView;

            m_controller.OnLabelListChanhed += m_controller_OnLabelListChanhed;

            bool slideLocked = (CurrentSlideView.IsLocked && PresentationController.Instance.CanUnlockSlide(CurrentSlideView.Slide)) || DesignerClient.Instance.IsStandAlone;
            bool presentationLocked = PresentationController.Instance.PresentationLocked || DesignerClient.Instance.IsStandAlone;

            this.Text = CurrentSlideView.SlideName + " - Свойства";

            Slide = CurrentSlideView.Slide.Copy();
            Slide.SaveSlideLevelChanges(CurrentSlideView.Slide);

            if (CurrentSlideView.GetOutgoingLinks().Count > 0)
            {
                OldDefLink = NewDefLink = CurrentSlideView.GetOutgoingLinks().Where(l => l.IsDefault).First();
            }

            #region Add bindings
            nameText.DataBindings.Add("Text", Slide, "Name");
            nameText.ReadOnly = !slideLocked;
            labelsList.Enabled = slideLocked;
            labelsList.DataBindings.DefaultDataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;
            RefreshLabels();

            hourSpanEdit.DataBindings.Add("Value", Slide.Time, "Hours");
            hourSpanEdit.Enabled = slideLocked;
            minuteSpanEdit.DataBindings.Add("Value", Slide.Time, "Minutes");
            minuteSpanEdit.Enabled = slideLocked;
            secondSpanEdit.DataBindings.Add("Value", Slide.Time, "Seconds");
            secondSpanEdit.Enabled = slideLocked;
            authorText.DataBindings.Add("Text", Slide, "Author");
            modifiedLabel.DataBindings.Add("Text", Slide, "Modified");
            commentText.DataBindings.Add("Text", Slide, "Comment");
            commentText.ReadOnly = !slideLocked;
            #endregion

            if (nextSlideList.Enabled = NewDefLink != null && presentationLocked)
            {
                List<SlideView> list = CurrentSlideView.GetOutgoingSlideViews();
                list.ForEach(s => nextSlideList.Items.Add(s));
                nextSlideList.SelectedIndex = list.IndexOf(NewDefLink.ToSlideView);
            }

            bool flag = m_controller.StartSlide == CurrentSlideView;
            isStartupCheckBox.Checked = flag;

            bool flag2 = !flag & CurrentSlideView.GetIncomingSlideLinks().Count == 0;

            isStartupCheckBox.Enabled = flag2 & presentationLocked;
            
            bool visible =  presentationLocked | slideLocked;

            if (presentationLocked && !slideLocked)
            {
                visible = isStartupCheckBox.Enabled || nextSlideList.Items.Count > 0;
            }

            okButton.Visible = visible;

            if (!visible)
            {
                this.AcceptButton = cancelButton;
                cancelButton.Text = "OK";
            }

        }
示例#14
0
 public SlideView(SlideView src)
     : this(src.Slide, src.GetPosition())
 {
     this._isLocked = src._isLocked;
     this.EnableShading = true;
 }
示例#15
0
 public bool CanLinkTo(SlideView to)
 {
     List<SlideLink> links = this.GetAllLinks();
     if (links.Count == 0) return true;
     return !links.Any(l => l.ToSlideView == to | l.FromSlideView == to);
 }