Ejemplo n.º 1
0
        private void Done(bool IsWeb)
        {
            //if (System.Diagnostics.Debugger.IsAttached)
            //{
            //    if (AllImages.Count == 0)
            //    {
            //        MessageBox.Show("No Image Found, Error in Image search function.");
            //        //return;
            //    }
            //}

            foreach (var item in AllImages)
            {
                //Create Thumbnails
                Task task = new Task(async() =>
                {
                    await imageIO.DirectConn_CreateThumbnails(item);
                });
                task.Start();
                if (InvokeRequired)
                {
                    Invoke(new Action(() => ReportProgressForThumbnails(item.ImageDirName)));
                }
            }

            if (AllImages.Count != 0)
            {
                imageIO.BubbleSortImages(AllImages);
                AllImages.Reverse();
            }

            if (InvokeRequired)
            {
                Invoke(new Action(() => waiter.Close()));
                Invoke(new Action(() => RefreshGalleryNotify = true));
                if (fileChangedCounter > 1)
                {// again raise event.
                    Invoke(new Action(() => FilesChanged = true));
                }
                Invoke(new Action(() => fileChangedCounter = 0));
                Invoke(new Action(() => CheckForMaxImageWarning()));
            }
            else
            {
                waiter.Close();
                RefreshGalleryNotify = true;
                CheckForMaxImageWarning();
                if (fileChangedCounter > 1)
                {// again raise event.
                    FilesChanged = true;
                }
                fileChangedCounter = 0;
            }
        }
Ejemplo n.º 2
0
        private void Done(bool IsWeb)
        {
            imageIO.BubbleSortImages(AllImages);

            foreach (var item in AllImages)
            {
                //TODO: #PPFunc:  Done call whole post processing function here, just thumbail func is enough
                //Create Thumbnails
                Task task = new Task(async() => { await imageIO.Wifi_PostProcessImages(item); });
                task.Start();
                task.Wait();
                //ReportProgressForThumbnails(item.ImageDirName);
            }

            AllImages.Reverse();
            if (InvokeRequired || waiter.InvokeRequired)
            {
                Invoke(new Action(() => waiter.Visible = false));
            }
            else
            {
                waiter.Visible = false;
            }
            if (IsWeb)
            {
                SimpleGallery gallery = new SimpleGallery
                {
                    WifiConnectHelpObject = this,
                    AnimationFormObject   = AnimationForm,
                    AllImages             = AllImages
                };
                this.Visible = false;
                gallery.Show();
            }
            else
            {
                DirectoryGallery gallery = new DirectoryGallery {
                    AllImages = AllImages
                };
                this.Visible = false;
                gallery.Show();
            }
        }