コード例 #1
0
        private void BrowseCommandImageClick(object param)
        {
            OpenFileDialog fileDialog = new OpenFileDialog();

            fileDialog.Multiselect = true;
            fileDialog.Filter      = "Image files (.jpg, .jpeg, .png)|*.jpg; *.jpeg; *.png";

            fileDialog.ShowDialog();
            ImagePaths.Clear();
            DisplayImagePaths = "";
            foreach (string filename in fileDialog.FileNames)
            {
                ImagePaths.Add(filename);
            }

            foreach (string ImagePaths in ImagePaths)
            {
                DisplayImagePaths += ImagePaths + "\n";
            }
        }
コード例 #2
0
        public void BeginSlideShow()
        {
            // Reset Data
            CurrentPicture = null;
            ImagePaths.Clear();

            // Validate SelectedPath
            var directories = SelectedPath.Split('%');

            foreach (var directory in directories)
            {
                if (!Directory.Exists(directory))
                {
                    MessageBox.Show("A specified file path is not a real directory. Please ammend.", "Path Not Found", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }
            }

            // Load Files
            var files = new List <string>();

            foreach (var directory in directories)
            {
                LoadFiles(directory, ref files);
            }
            foreach (var file in files)
            {
                ImagePaths.Add(file);
            }

            // Shuffle
            ImagePaths.Shuffle();

            // TODO: Check speedy loading

            // TODO: settings

            // Progress
            SlideshowProgress(null, null);
        }