Beispiel #1
0
        private void UpdateThumbsPanel()
        {
            flThumbs.SuspendLayout();
            flThumbs.Controls.Clear();

            if (_thumbs == null)
            {
                _thumbs = new List <Thumbnail>();
            }

            if (_thumbs.Any() && _mainThumb == null)
            {
                MainThumb = _thumbs.OrderBy(t => t.Position).First();
            }

            foreach (var thumb in _thumbs.OrderBy(t => t.Position))
            {
                ThumbnailViewer tv = new ThumbnailViewer(thumb);
                tv.Width             = 180;
                tv.Height            = 110;
                tv.CheckedChanged   += new EventHandler(tv_CheckedChanged);
                tv.MouseDown        += new MouseEventHandler(tv_MouseDown);
                tv.MouseMove        += new MouseEventHandler(tv_MouseMove);
                tv.MouseUp          += new MouseEventHandler(tv_MouseUp);
                tv.MouseDoubleClick += new MouseEventHandler(tv_MouseDoubleClick);
                flThumbs.Controls.Add(tv);
                tv.ContextMenuStrip = cmsThumbnail;
            }

            flThumbs.ResumeLayout();
            flThumbs.PerformLayout();
            tsmiUploadThumbnails.Enabled = _fileLoaded && _thumbs.Any(t => t.IsChecked);

            UpdateThumbsStatus();
        }
Beispiel #2
0
        private void UpdateThumbsPanel()
        {
            flThumbs.SuspendLayout();
            flThumbs.Controls.Clear();

            if (_thumbs == null)
                _thumbs = new List<Thumbnail>();

            if (_thumbs.Any() && _mainThumb==null)
            {
                MainThumb = _thumbs.OrderBy(t=>t.Position).First();
            }

            foreach (var thumb in _thumbs.OrderBy(t => t.Position))
            {
                ThumbnailViewer tv = new ThumbnailViewer(thumb);
                tv.Width = 180;
                tv.Height = 110;
                tv.CheckedChanged += new EventHandler(tv_CheckedChanged);
                tv.MouseDown += new MouseEventHandler(tv_MouseDown);
                tv.MouseMove += new MouseEventHandler(tv_MouseMove);
                tv.MouseUp += new MouseEventHandler(tv_MouseUp);
                tv.MouseDoubleClick += new MouseEventHandler(tv_MouseDoubleClick);
                flThumbs.Controls.Add(tv);
                tv.ContextMenuStrip = cmsThumbnail;

            }

            flThumbs.ResumeLayout();
            flThumbs.PerformLayout();
            tsmiUploadThumbnails.Enabled = _fileLoaded && _thumbs.Any(t => t.IsChecked);

            UpdateThumbsStatus();
        }