Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/tools/CedmaImporter/ImporterForm.cs @ 2587

Last change on this file since 2587 was 2272, checked in by gkronber, 15 years ago

Worked on persistence of models into the DB. #719 (CEDMA Importer)

File size: 1.1 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Data;
5using System.Drawing;
6using System.Linq;
7using System.Text;
8using System.Windows.Forms;
9using System.IO;
10using HeuristicLab.CEDMA.Server;
11
12namespace CedmaImporter {
13  public partial class ImporterForm : Form {
14    private Problem problem;
15
16    public ImporterForm() {
17      InitializeComponent();
18      problem = new Problem();
19      Control problemView = (UserControl)problem.CreateView();
20      problemView.Dock = DockStyle.Fill;
21      problemViewPanel.Controls.Add(problemView);     
22    }
23
24    private void importButton_Click(object sender, EventArgs e) {
25      Importer importer = new Importer(problem);
26
27      OpenFileDialog dialog = new OpenFileDialog();
28      DialogResult result = dialog.ShowDialog();
29      while (result != DialogResult.Cancel) {
30        string fileName = dialog.FileName;
31        string directoryName = Path.GetDirectoryName(fileName);
32        importer.Import(fileName, directoryName);
33        result = dialog.ShowDialog();
34      }
35    }
36  }
37}
Note: See TracBrowser for help on using the repository browser.