Beispiel #1
0
 private void Drop(DragEventArgs e, int target)
 {
     if (e.Data.GetDataPresent(typeof(CameraSummary)))
     {
         CameraSummary summary = (CameraSummary)e.Data.GetData(typeof(CameraSummary));
         if (summary != null)
         {
             CameraTypeManager.LoadCamera(summary, target);
         }
     }
     else if (e.Data.GetDataPresent(DataFormats.StringFormat))
     {
         string filename = (string)e.Data.GetData(DataFormats.StringFormat);
         FileLoadAsked(this, new FileLoadAskedEventArgs(filename, target));
     }
     else if (e.Data.GetDataPresent(DataFormats.FileDrop))
     {
         Array fileArray = (Array)e.Data.GetData(DataFormats.FileDrop);
         if (fileArray != null)
         {
             string filename = fileArray.GetValue(0).ToString();
             FileLoadAsked(this, new FileLoadAskedEventArgs(filename, target));
         }
     }
 }
        protected override bool ExecuteCommand(int cmd)
        {
            ThumbnailViewerCameraCommands command = (ThumbnailViewerCameraCommands)cmd;

            switch (command)
            {
            case ThumbnailViewerCameraCommands.RenameSelected:
                if (selectedThumbnail != null)
                {
                    selectedThumbnail.StartRenaming();
                }
                break;

            case ThumbnailViewerCameraCommands.LaunchSelected:
                CameraTypeManager.LoadCamera(selectedThumbnail.Summary, -1);
                break;

            case ThumbnailViewerCameraCommands.Refresh:
                refreshImages = true;
                CameraTypeManager.DiscoverCameras();
                this.Focus();
                break;

            default:
                return(base.ExecuteCommand(cmd));
            }

            return(true);
        }
        private void Thumbnail_LaunchCamera(object sender, EventArgs e)
        {
            ThumbnailCamera thumbnail = sender as ThumbnailCamera;

            if (thumbnail != null)
            {
                CameraTypeManager.LoadCamera(thumbnail.Summary, -1);
            }
        }
Beispiel #4
0
        private void LvCameras_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            ListViewItem lvi = lvCameras.GetItemAt(e.X, e.Y);

            if (lvi == null || lvCameras.SelectedItems == null || lvCameras.SelectedItems.Count != 1)
            {
                return;
            }

            int index = IndexOfCamera(cameraSummaries, lvi.Name);

            if (index >= 0)
            {
                CameraTypeManager.LoadCamera(cameraSummaries[index], -1);
            }
        }
Beispiel #5
0
        private void LaunchSelectedCamera(ListView lv)
        {
            if (lv == null || !lv.Focused)
            {
                return;
            }

            if (lv.SelectedItems == null || lv.SelectedItems.Count != 1)
            {
                return;
            }

            int index = IndexOfCamera(cameraSummaries, lv.SelectedItems[0].Name);

            if (index >= 0)
            {
                CameraTypeManager.LoadCamera(cameraSummaries[index], -1);
            }
        }
        private void LaunchSelectedCamera(ListView lv, TreeView tv)
        {
            if (lv == null || tv == null)
            {
                return;
            }

            if (lv.Focused)
            {
                if (lv.SelectedItems == null || lv.SelectedItems.Count != 1)
                {
                    return;
                }

                int index = IndexOfCamera(cameraSummaries, lv.SelectedItems[0].Name);
                if (index >= 0)
                {
                    CameraTypeManager.LoadCamera(cameraSummaries[index], -1);
                }
            }
            else if (tv.Focused)
            {
                if (tv.SelectedNode == null)
                {
                    return;
                }

                CaptureHistoryEntry entry = tv.SelectedNode.Tag as CaptureHistoryEntry;
                if (entry == null)
                {
                    return;
                }

                string path = entry.CaptureFile;
                if (path == null)
                {
                    return;
                }

                VideoTypeManager.LoadVideo(path, -1);
            }
        }