public FolderSettingDialog(FilePath filePathIn, FilePath outputPathIn)
        {
            filePath = filePathIn;
            outputPath = outputPathIn;
            InitializeComponent();

            folderPathTextBox.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
            outputPathTextBox.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            if (Properties.Settings.Default.lastInputPath == "NULL")
            {
                Properties.Settings.Default.lastInputPath = folderPathTextBox.Text;
            }
            else
            {
                folderPathTextBox.Text = Properties.Settings.Default.lastInputPath;
            }
            if (Properties.Settings.Default.lastOutputPath == "NULL")
            {
                Properties.Settings.Default.lastOutputPath = outputPathTextBox.Text;
            }
            else
            {
                outputPathTextBox.Text = Properties.Settings.Default.lastOutputPath;
            }
            Properties.Settings.Default.Save();
        }
Esempio n. 2
0
        public MainWindow(FilePath filePathIn, FilePath outputPathIn)
        {
            InitializeComponent();
            currentFolder.Text = filePathIn.filePath;
            outputFolder = outputPathIn;

            string[] filesJPG = FileUtillity.GetFiles(currentFolder.Text, "*.jpg").ToArray<string>();
            string[] filesPNG = FileUtillity.GetFiles(currentFolder.Text, "*.png").ToArray<string>();
            string[] files = filesJPG.Concat(filesPNG).ToArray();
            foreach (string file in files)
            {
                DateTime lastModified = File.GetLastWriteTime(file);
                pictureInput.Add(new Picture(file, lastModified));
            }
            fileCountTextBox.Text = Convert.ToString(pictureInput.Count());

            outputDropdown.Items.Add(outputFolder.filePath);
            outputDropdown.SelectedItem = outputDropdown.Items[0];

            pictureInput.Sort();
            if (pictureInput.Count() > 0)
            {
                CurrentPhotoBox.Load(pictureInput[0].filePath);
                currentFolder.Text = pictureInput[0].filePath;

                widthTextBox.Text = CurrentPhotoBox.Image.Width.ToString() + "px";
                heightTextBox.Text = CurrentPhotoBox.Image.Height.ToString() + "px";

                lastModifiedTextBox.Text = pictureInput[0].lastModified.ToString();

            }
        }
Esempio n. 3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            FilePath filePath = new FilePath("");
            FilePath outputPath = new FilePath("");
            Application.Run(new FolderSettingDialog(filePath, outputPath));

            Application.Run(new MainWindow(filePath, outputPath));
        }