private void Thumbnail_LaunchCamera(object sender, EventArgs e) { ThumbnailCamera thumbnail = sender as ThumbnailCamera; if (thumbnail != null) { CameraTypeManager.LoadCamera(thumbnail.Summary, -1); } }
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); }
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(); }
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; }
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(); }
private void Thumbnail_SummaryUpdated(object sender, EventArgs e) { ThumbnailCamera thumbnail = sender as ThumbnailCamera; CameraTypeManager.UpdatedCameraSummary(thumbnail.Summary); }