コード例 #1
0
        /// <summary>
        /// Sets the gallery for the UIPicture Panel. This method generates it's own UIPictureBox controls
        /// using a background worker. OVERLOAD: THIS OVERLOAD IS POST-PROCESSED FILES.
        /// </summary>
        /// <param name="Gallery"></param>
        /// <param name="SelectionMode"></param>
        public void SetGallery(PlusPlayLib.Bus.Gallery gallery, bool selectionMode)
        {
            try
            {
                Initialize(false);


                foreach (UIPictureBox children in WrapPanelMain.Children)
                    children.UIPictureBox_OverrideSelectionEvent(Key.None, children);

                WrapPanelMain.Children.Clear();



                for (int i = 0; i < gallery.Files.Count; i++)
                {
                    UIControls.UIPictureBox pb = new UIPictureBox();
                    pb.OverrideSelectionEvent += pb_OverrideSelectionEvent;
                    _pictures.Add(gallery.Files[i].FullName);

                    Array.Resize(ref _boxes, _boxes.Length + 1);
                    _boxes[i] = pb;

                    WrapPanelMain.Children.Add(pb);
                }

                _imageLoaderBackgroundWorker.RunWorkerAsync();
            }
            catch (Exception) { }
        }
コード例 #2
0
        /// <summary>
        /// Sets the gallery for the UIPicture Panel. This method generates it's own UIPictureBox controls
        /// using a background worker. OVERLOAD: THIS OVERLOAD IS PRE-PROCESSED FILES.
        /// </summary>
        /// <param name="Gallery Location" type="System.IO.DirectoryInfo"></param>
        /// <param name="ModelGaleryName" type="string[]"></param>
        public void SetGallery(string galleryFilePath)
        {
            try
            {
                Initialize(true);
                DirectoryInfo galleryDirectory = new DirectoryInfo(galleryFilePath);

                WrapPanelMain.Children.Clear();

                FileInfo[] galleryFiles = galleryDirectory.GetFiles();

                for (int i = 0; i < galleryFiles.Length; i++)
                {
                    UIControls.UIPictureBox pb = new UIPictureBox();
                    pb.OverrideSelectionEvent += pb_OverrideSelectionEvent;
                    _pictures.Add(galleryFiles[i].FullName);

                    Array.Resize(ref _boxes, _boxes.Length + 1);
                    _boxes[i] = pb;

                    WrapPanelMain.Children.Add(pb);
                }

                _imageLoaderBackgroundWorker.RunWorkerAsync();
            }
            catch (Exception) { }
        }