Exemplo n.º 1
0
        public void AddConnection()
        {
            EditConnectionForm f = new EditConnectionForm(new Connection());

            if (f.ShowDialog() == DialogResult.OK)
            {
                mainForm.Tree.Connections.Add(f.Connection);
                mainForm.Tree.DrawTree();
            }
        }
Exemplo n.º 2
0
        public void EditConnection(Connection connection)
        {
            Connection         clone = (Connection)connection.Clone();
            EditConnectionForm f     = new EditConnectionForm(clone);

            if (f.ShowDialog() == DialogResult.OK)
            {
                bool wasOpened = connection.Opened;
                if (wasOpened)
                {
                    CloseConnection(connection);
                }
                connection.Assign(clone);
                if (wasOpened)
                {
                    OpenConnection(connection);
                }
                mainForm.Tree.DrawTree();
            }
        }