private void buttonChooseStack_Click(object sender, EventArgs e) { if (Filenames.Count > 0) { Filenames.Clear(); } openFileDialogStack.Filter = _dialogFilterStack; openFileDialogStack.InitialDirectory = _initDir; openFileDialogStack.FileName = ""; DialogResult result = openFileDialogStack.ShowDialog(); if (result == DialogResult.OK) { Stackname = openFileDialogStack.FileName; if (Stackname != null) { textBox1.Text = Stackname; WSIExtraction.Stack stack = ReadWriteUtils.DeserializeObjectFromJSON <WSIExtraction.Stack>(Stackname); foreach (WSIExtraction.Slice slice in stack.Section) { Filenames.Add(Path.Combine(Path.GetDirectoryName(Stackname), slice.Path)); } } textBox1.Text = Stackname; EnableButtons(); } }
/// <inheritdoc /> public void Dispose() { foreach (var contentsValue in Contents.Values) { contentsValue?.Dispose(); } Contents.Clear(); Filenames.Clear(); Formats.Clear(); OriginalFormats.Clear(); }
private void buttonChoosePNGs_Click(object sender, EventArgs e) { if (Filenames.Count > 0) { Filenames.Clear(); } openFileDialogImages.Multiselect = true; openFileDialogImages.Filter = _dialogFilterImages; openFileDialogImages.InitialDirectory = _initDir; openFileDialogImages.FileName = ""; DialogResult result = openFileDialogImages.ShowDialog(); if (result == DialogResult.OK) { foreach (string path in openFileDialogImages.FileNames) { Filenames.Add(path); } } textBox2.Text = string.Join("; ", Filenames); EnableButtons(); }