private void pictureBox1_Click(object sender, EventArgs e) { this.Dispose(); if (OnDeleteTable != null) { AddTableEventArgs ate = new AddTableEventArgs(this.table, new Point()); OnDeleteTable(sender, ate); } }
private void OnDeleteTable(object sender, AddTableEventArgs e) { for (int i = links.Count - 1; i >= 0; i--) { if ((links[i].From.Table == e.table) || (links[i].To.Table == e.table)) { links.RemoveAt(i); } } splitContainer1.Panel1.Refresh(); }
private void OnAddTable(object sender, AddTableEventArgs e) { Table tbl = (Table)e.table.Clone(); tbl.Alias = GetUniqueAlias(tbl); TableView tv = queryDesigner.DoAddTable(tbl, e.position); tv.OnAddLink += OnAddLink; tv.OnSelectField += OnSelectField; tv.OnDeleteTable += OnDeleteTable; query.TableList.Add(tbl); }
private void OnDeleteTable(object sender, AddTableEventArgs e) { for (int i = query.SelectedFields.Count - 1; i >= 0; i--) { if (query.SelectedFields[i].Table == e.table) { query.SelectedFields.RemoveAt(i); } } query.deleteTable(e.table); queryDesigner.Fields = query.SelectedFields; queryDesigner.DoRefreshLinks(); }
private void listView1_DoubleClick(object sender, EventArgs e) { ListView _sender = sender as ListView; if (_sender != null) { if ((OnAddTable != null) && (_sender.SelectedItems.Count != 0)) { AddTableEventArgs ate = new AddTableEventArgs(_sender.SelectedItems[0].Tag as Table, posC.Next); OnAddTable(sender, ate); } } }
private void splitContainer2_Panel1_DragDrop(object sender, DragEventArgs e) { ListViewItem _item = (ListViewItem)e.Data.GetData(typeof(ListViewItem)); if (_item != null) { if (OnAddTable != null) { Point p = (sender as Panel).PointToClient(new Point(e.X, e.Y)); AddTableEventArgs ate = new AddTableEventArgs(_item.Tag as Table, p); OnAddTable(sender, ate); } } }