summaryrefslogtreecommitdiff
path: root/spedytor/dbWindow.cs
blob: 3002075721ae07be36a8104dddec9ef8ef4dfd97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace spedytor
{
    public partial class dbWindow : Form
    {
        private Form1 mainForm;

        public dbWindow()
        {
            InitializeComponent();
        }

        public void setParent(Form1 parent)
        {
            this.mainForm = parent;
        }

        private void bOK_Click(object sender, EventArgs e)
        {
            if (this.mainForm != null)
            {
                List<string> selected = new List<string>();
                foreach (int index in this.lbDatabases.SelectedIndices)
                {
                    selected.Add(this.lbDatabases.Items[index].ToString());
                }
                this.mainForm.setSelectedDBs(selected);
            }
            this.Close();
        }

    }
}