コード例 #1
0
        private void ButtonAdd_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog fileDialog = new OpenFileDialog();
            FileData       fd         = new FileData(null, null);

            if (fileDialog.ShowDialog() == true)
            {
                fd.FileDirectory = fileDialog.FileName;
            }

            if (fd.FileDirectory != null)
            {
                FileEdit editwindow = new FileEdit(fd)
                {
                    Owner = this
                };
                editwindow.ShowDialog();

                if (editwindow.DialogSaved)
                {
                    listBox.Items.Add(fd.FileName);
                    data.dataSet.FileDataList.Add(fd);
                }
            }
        }
コード例 #2
0
        private void ButtonEdit_Click(object sender, RoutedEventArgs e)
        {
            if (listBox.SelectedIndex != -1)
            {
                FileEdit editwindow = new FileEdit(data.dataSet.FileDataList[listBox.SelectedIndex])
                {
                    Owner = this
                };
                editwindow.ShowDialog();

                listBox.Items[listBox.SelectedIndex] = data.dataSet.FileDataList[listBox.SelectedIndex].FileName;
            }
            else
            {
                MessageBox.Show("None of the itemes were selected", "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }