示例#1
0
 private void OnDrop(object sender, DragEventArgs e)
 {
     if (e.Data.GetDataPresent(DataFormats.FileDrop))
     {
         e.Effects = DragDropEffects.Link;
         string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
         _dataSetSelector?.Dispose();
         _dataSetSelector = new DataSetSelector(_viewModel);
         _dataSetSelector.Open(files[0]);
     }
 }
示例#2
0
        private void LoadFolder()
        {
            var dialog = new CommonOpenFileDialog
            {
                IsFolderPicker   = true,
                InitialDirectory = Settings.Default.LastUsedFolder
            };

            if (dialog.ShowDialog() == CommonFileDialogResult.Ok)
            {
                _dataSetSelector?.Dispose();
                _dataSetSelector = new DataSetSelector(_viewModel);
                _dataSetSelector.Open(dialog.FileName);
            }
        }