private void CreateButton_Click(object sender, EventArgs e)
        {
            var diag = new VistaFolderBrowserDialog
            {
                Description            = "Choose Raw Director",
                RootFolder             = Environment.SpecialFolder.MyComputer,
                UseDescriptionForTitle = true,
                ShowNewFolderButton    = false
            };

            if (diag.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            var destlistpath = Path.Combine(diag.SelectedPath, "destinations.txt");

            if (!File.Exists(destlistpath))
            {
                MessageBox.Show("Destinations file not found!");
                return;
            }
            if (saveFileDialog1.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            string[] destlist;
            using (var streamReader = new StreamReader(destlistpath))
            {
                destlist = streamReader.Loop().ToArray();
            }
            var job = ResizingJob.Create(destlist, diag.SelectedPath, saveFileDialog1.FileName);

            JobSelected.Invoke(this, new JobSelectedArgs(job));
        }
        private void LoadButton_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            ResizingJob job = ResizingJob.load(openFileDialog1.FileName);

            JobSelected.Invoke(this, new JobSelectedArgs(job));
        }
Esempio n. 3
0
        public void rePoolDests()
        {
            var ndpath = Path.Combine(rawdir, "destinations.txt");

            string[] newdests;
            using (var reader = new StreamReader(ndpath))
            {
                newdests = reader.Loop().ToArray();
            }
            var transform = adjustDestMap(_dests.Select(x => x.Item1), newdests);

            foreach (var image in _images.Keys.ToArray())
            {
                _images[image] = ResizingJob.transform(_images[image], transform, newdests.Length);
            }
            _dests = newdests.Select((a, i) =>
            {
                var propath = Path.Combine(a, "preset.txt");
                return(new KeyValuePair <string, Tuple <int, ResizingProfile> >(a, Tuple.Create(i, ResizingProfile.fromFile(propath))));
            }).ToDictionary();
        }
 public JobSelectedArgs(ResizingJob job)
 {
     this.job = job;
 }
 private void selectJob(string jobfile)
 {
     this.jobSelectControl1_OnJobSelected(this, new JobSelectedArgs(ResizingJob.load(jobfile)));
 }