Exemplo n.º 1
0
        private void Thumbnail_LaunchCamera(object sender, EventArgs e)
        {
            ThumbnailCamera thumbnail = sender as ThumbnailCamera;

            if (thumbnail != null)
            {
                CameraTypeManager.LoadCamera(thumbnail.Summary, -1);
            }
        }
Exemplo n.º 2
0
        private void AddThumbnail(ThumbnailCamera thumbnail)
        {
            thumbnail.LaunchCamera   += Thumbnail_LaunchCamera;
            thumbnail.CameraSelected += Thumbnail_CameraSelected;
            thumbnail.SummaryUpdated += Thumbnail_SummaryUpdated;
            thumbnail.DeleteCamera   += Thumbnail_DeleteCamera;

            thumbnailControls.Add(thumbnail);
            this.Controls.Add(thumbnail);
        }
Exemplo n.º 3
0
        private void Thumbnail_DeleteCamera(object sender, EventArgs e)
        {
            // Delete camera in prefs (blurbs).
            // Should be enough to remove the thumbnail at next discovery heart beat.
            ThumbnailCamera thumbnail = sender as ThumbnailCamera;

            CameraTypeManager.ForgetCamera(thumbnail.Summary);

            refreshImages = true;
            CameraTypeManager.DiscoverCameras();
        }
Exemplo n.º 4
0
        private void Thumbnail_CameraSelected(object sender, EventArgs e)
        {
            ThumbnailCamera thumbnail = sender as ThumbnailCamera;

            if (thumbnail == null)
            {
                return;
            }

            if (selectedThumbnail != null && selectedThumbnail != thumbnail)
            {
                selectedThumbnail.SetUnselected();
            }

            selectedThumbnail = thumbnail;
        }
Exemplo n.º 5
0
        private void RemoveThumbnail(ThumbnailCamera thumbnail)
        {
            if (imageReceived.Contains(thumbnail))
            {
                imageReceived.Remove(thumbnail);
            }

            thumbnail.LaunchCamera   -= Thumbnail_LaunchCamera;
            thumbnail.CameraSelected -= Thumbnail_CameraSelected;
            thumbnail.SummaryUpdated -= Thumbnail_SummaryUpdated;
            thumbnail.DeleteCamera   -= Thumbnail_DeleteCamera;

            this.Controls.Remove(thumbnail);
            thumbnailControls.Remove(thumbnail);
            if (selectedThumbnail == thumbnail)
            {
                selectedThumbnail = null;
            }

            thumbnail.Dispose();
        }
Exemplo n.º 6
0
        private void Thumbnail_SummaryUpdated(object sender, EventArgs e)
        {
            ThumbnailCamera thumbnail = sender as ThumbnailCamera;

            CameraTypeManager.UpdatedCameraSummary(thumbnail.Summary);
        }