Ejemplo n.º 1
0
        /// <summary>
        /// If the button is clicked create a directory and
        /// copy the files(images) to the directory
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ImagesToFolder(object sender, RoutedEventArgs e)
        {
            if (FileList.Count < 9)                            // if you need more images
            {
                MessageBox.Show("Voeg meer afbeeldingen toe"); // show error
            }
            else
            {
                string ThemeDirectoryName = "themas/";                            // directory with all themes

                string targetPath = ThemeDirectoryName + themaNaam.Text;          // directory for this theme

                if (Directory.Exists(targetPath))                                 // if directory name already exist
                {
                    MessageBox.Show("Dit thema bestaat al kies een andere naam"); // show error
                }
                else
                {
                    Directory.CreateDirectory(targetPath);                                 // create the directory ( theme )

                    foreach (string file in FileList)                                      // foreach image
                    {
                        File.Copy(file, Path.Combine(targetPath, Path.GetFileName(file))); // copy the images to theme directory
                    }

                    this.Hide();
                    var newWindow = new thema();
                    newWindow.Show();
                    this.Close();
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Navigeer naar thema kiezen om een thema uit te kiezen.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Themakiezen(object sender, RoutedEventArgs e)
        {
            this.Hide();
            thema thema = new thema();

            thema.Show();
            this.Close();
        }