private BeeImage GetNextImage(bool advancePointers)
        {
            BeeStack nextStack = BeeBurnVM.Get().EnsureActiveStack();
            BeeImage biNext;

            if (advancePointers)
            {
                biNext = nextStack.GetNextImage(PlayOption == PlayOptions.RepeatThisList);
            }
            else
            {
                biNext = nextStack.PeekNextImage(PlayOption == PlayOptions.RepeatThisList);
            }

            if (biNext == null && PlayOption == PlayOptions.NextList)
            {
                nextStack = BeeBurnVM.Get().GetNextStack(true, advancePointers);

                if (nextStack != null)
                {
                    if (advancePointers)
                    {
                        return(nextStack.GetNextImage(PlayOption == PlayOptions.RepeatThisList));
                    }
                    else
                    {
                        return(nextStack.PeekNextImage(PlayOption == PlayOptions.RepeatThisList));
                    }
                }
            }
            return(biNext);
        }
        private void QueueNextImage()
        {
            EnsureProjectionWindow();
            BeeStack activeStack = BeeBurnVM.Get().EnsureActiveStack();
            BeeImage biNext      = GetNextImage(true);

            if (biNext == null)
            {
                PauseProjection(true);
                m_proj.FadeToBlack();
                return;
            }

            CurrentImage.Source = biNext.BitmapFrame;
            RefreshNextImageControl();

            double panSeconds = m_proj.QueueImage(biNext) + BeeBurnVM.Get().ConfigSettings.ImageFadeTime;

            //  DispatcherTimer setup
            if (m_dispatcherTimer == null)
            {
                m_dispatcherTimer       = new System.Windows.Threading.DispatcherTimer();
                m_dispatcherTimer.Tick += new EventHandler(ProjectionTimerTick);
            }

            m_dispatcherTimer.Tag = panSeconds;

            m_proj.UpdateProgress(0);
            m_timerStart = DateTime.Now;
            m_dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 50);
            m_dispatcherTimer.Start();
        }
        private void ActiveGrid_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            m_dragIndex = GetCurrentRowIndex(e.GetPosition);
            if (m_dragIndex < 0)
            {
                return;
            }

            ActiveGrid.SelectedIndex = m_dragIndex;
            BeeStack bsSel = ActiveGrid.Items[m_dragIndex] as BeeStack;

            if (bsSel == null)
            {
                return;
            }
            var dragEffects = DragDropEffects.Move;

            if (DragDrop.DoDragDrop(ActiveGrid, bsSel, dragEffects) != DragDropEffects.None)
            {
                ActiveGrid.SelectedItem = bsSel;
            }
        }
 public BeeStackEditor(BeeStack stack)
 {
     InitializeComponent();
     Stack = stack;
 }