Exemplo n.º 1
0
        private void DisplayImageTimerTick(object sender, EventArgs e)
        {
            try
            {
                string path = this.photoRepository.NextPhotoFilePath;

                ICollageView view = this.GetNextView();

                var control = new ImageDisplayUserControl(path, this);
                view.ImageCanvas.Children.Add(control);
                this.imageQueue.Enqueue(control);

                if (this.imageQueue.Count > this.MaxInQueue)
                {
                    this.RemoveImageFromQueue(view);
                }

                this.SetUserControlPosition(control, view);
            }
            catch (Exception ex)
            {
                this.controller.HandleError(ex);
                this.controller.Shutdown();
            }
        }
Exemplo n.º 2
0
 private void RemoveImageFromPanel(ImageDisplayUserControl control, ICollageView view)
 {
     try
     {
         if (view.ImageCanvas.Children.Contains(control))
         {
             view.ImageCanvas.Children.Remove(control);
         }
     }
     catch (Exception ex)
     {
         this.controller.HandleError(ex);
     }
 }