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));
        }
示例#3
0
 private void OkButton_Click(object sender, RoutedEventArgs e)
 {
     Callback?.Invoke(JobList.SelectedItem as Site.Job);
     Close();
 }