/// <summary>
        /// 
        /// </summary>
        /// <param name="thumbnailView"></param>
        /// <param name="state"></param>
        public void Run(ThumbnailView thumbnailView, ThumbnailWorkerState state)
        {
            _thumbnailView = thumbnailView;
            _tnvState = state;

            _bgWorker.RunWorkerAsync();
        }
Beispiel #2
0
        public void Run(ThumbnailView thumbnailView, ThumbnailWorkerState state)
        {
            foreach (ClearListCompleted instance in _clearListCompleted.GetInvocationList())
                instance(_thumbnailView, _tnvState);

            //_thumbnailView = thumbnailView;
            //_tnvState = state;
            //_bgWorker.RunWorkerAsync();
        }
Beispiel #3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="thumbnailView"></param>
        /// <param name="state"></param>
        /// <param name="metaItemQueue"></param>
        public void Run(ThumbnailView thumbnailView, ThumbnailWorkerState state, Queue<ThumbnailMetaItem> metaItemQueue)
        {
            _thumbnailView = thumbnailView;
            _tnvState = state;
            _metaItemQueue = metaItemQueue;
            _loadedMetaItemQueue = new Queue<ThumbnailMetaItem>();
            _bgWorker.RunWorkerAsync();

            _timer.Start();
        }
Beispiel #4
0
        /// <summary>
        /// 
        /// </summary>
        public ThumbnailView()
            : base()
        {
            //_clearListWorker = new ClearListWorker();
            _loadContentWorker = new LoadContentWorker();
            _loadImageWorker = new LoadImageWorker();

            _loadContentWorker.OnCompleted += new LoadContentCompleted(_loadImageWorker.Run);
            _loadImageWorker.OnCompleted += new LoadImageCompleted(_loadImageWorker_OnCompleted);

            _thumbnailWorkerState = new ThumbnailWorkerState(this, _lvItemDict);

            //this.View = View.LargeIcon;
            this.View = View.Details;

            //Detail View
            this.Columns.Add(new ColumnHeader());
            this.Columns.Add(new ColumnHeader());
            this.Columns.Add(new ColumnHeader());
            this.Columns.Add(new ColumnHeader());
            this.Columns[0].Text = "Name";
            this.Columns[1].Text = "Size";
            this.Columns[2].Text = "Type";
            this.Columns[3].Text = "Date";

            this.DoubleBuffered = true;
            this.MultiSelect = false;

            //Large image list
            this.LargeImageList = new ImageList();
            this.LargeImageList.ImageSize = new Size(128, 128);
            this.LargeImageList.ColorDepth = ColorDepth.Depth32Bit;
            //Small image list
            this.SmallImageList = new ImageList();
            this.SmallImageList.ImageSize = new Size(24, 24);
            this.SmallImageList.ColorDepth = ColorDepth.Depth32Bit;

            //ThumbnailView
            this.Activation = System.Windows.Forms.ItemActivation.TwoClick;

            //Timer
            _showTimer = new System.Windows.Forms.Timer();
            _showTimer.Interval = 150;
            _showTimer.Tick += new EventHandler(_showTimer_Tick);

            //Sorting
            _thumbnailSorter.Column = 2;
            _thumbnailSorter.ColumnDataType = "String";
            _thumbnailSorter.SortOrder = SortOrder.Ascending;

            //this.ListViewItemSorter = _thumbnailSorter; //Enable sorting

            //Events
            //this.ItemActivate += new EventHandler(ThumbnailView_ItemActivate);
            this.SelectedIndexChanged += new EventHandler(ThumbnailView_SelectedIndexChanged);
            this.MouseDoubleClick += new MouseEventHandler(ThumbnailView_MouseDoubleClick);
            this.ColumnClick += new ColumnClickEventHandler(ThumbnailView_ColumnClick);
        }