Beispiel #1
0
        private void ThumbListViewItem_VideoSelected(object sender, EventArgs e)
        {
            CancelEditMode();
            ThumbnailFile tlvi = sender as ThumbnailFile;

            if (tlvi == null || selectedThumbnail == tlvi)
            {
                return;
            }

            Deselect(false);
            selectedThumbnail = tlvi;
            lastSelectedFile  = tlvi.FileName;
            if (!externalSelection)
            {
                // Force focus so the hotkeys can be received.
                // Select the control so the whole page doesn't jump up to the top when we set focus.
                tlvi.Select();
                this.Focus();
                NotificationCenter.RaiseFileSelected(this, tlvi.FileName);
            }
            else
            {
                this.ScrollControlIntoView(tlvi);
            }

            externalSelection = false;
        }
Beispiel #2
0
        private void ThumbListViewItem_LaunchVideo(object sender, EventArgs e)
        {
            CancelEditMode();
            ThumbnailFile tlvi = sender as ThumbnailFile;

            if (tlvi != null && !tlvi.IsError && FileLoadAsked != null)
            {
                FileLoadAsked(this, new FileLoadAskedEventArgs(tlvi.FileName, -1));
            }
        }
Beispiel #3
0
        private void CancelEditMode()
        {
            editing = false;

            // Browse all thumbs and make sure they are all in normal mode.
            for (int i = 0; i < this.Controls.Count; i++)
            {
                ThumbnailFile tlvi = this.Controls[i] as ThumbnailFile;
                if (tlvi != null)
                {
                    tlvi.CancelEditMode();
                }
            }
        }
Beispiel #4
0
        private void Deselect(bool raiseEvent)
        {
            if (selectedThumbnail == null)
            {
                return;
            }

            selectedThumbnail.SetUnselected();
            selectedThumbnail = null;

            if (raiseEvent)
            {
                NotificationCenter.RaiseFileSelected(this, null);
            }
        }
Beispiel #5
0
        private void CreateThumbs(List <String> _fileNames)
        {
            int index = 0;

            foreach (string file in _fileNames)
            {
                ThumbnailFile tlvi = new ThumbnailFile(file);
                tlvi.LaunchVideo     += ThumbListViewItem_LaunchVideo;
                tlvi.VideoSelected   += ThumbListViewItem_VideoSelected;
                tlvi.FileNameEditing += ThumbListViewItem_FileNameEditing;
                tlvi.Tag              = index;
                thumbnails.Add(tlvi);
                this.Controls.Add(tlvi);
                index++;
            }
        }
Beispiel #6
0
        public void Clear()
        {
            selectedThumbnail = null;
            NotificationCenter.RaiseFileSelected(this, null);

            for (int i = thumbnails.Count - 1; i >= 0; i--)
            {
                ThumbnailFile thumbnail = thumbnails[i];

                thumbnail.LaunchVideo     -= ThumbListViewItem_LaunchVideo;
                thumbnail.VideoSelected   -= ThumbListViewItem_VideoSelected;
                thumbnail.FileNameEditing -= ThumbListViewItem_FileNameEditing;

                thumbnails.Remove(thumbnail);
                this.Controls.Remove(thumbnail);

                thumbnail.DisposeImages();
                thumbnail.Dispose();
            }
        }