void ConnectionProperties_Click(object sender, EventArgs e) { if (_etconn == null) { return; } FormEventTableConnection dlg = new FormEventTableConnection(); dlg.DbConnectionString = _etconn.DbConnectionString; dlg.TableName = _etconn.TableName; dlg.IdField = _etconn.IdFieldName; dlg.XField = _etconn.XFieldName; dlg.YField = _etconn.YFieldName; dlg.SpatialReference = _etconn.SpatialReference; if (dlg.ShowDialog() == DialogResult.OK) { EventTableConnection etcon = new EventTableConnection( dlg.DbConnectionString, dlg.TableName, dlg.IdField, dlg.XField, dlg.YField, dlg.SpatialReference); ConfigConnections connStream = new ConfigConnections("eventtable", "546B0513-D71D-4490-9E27-94CD5D72C64A"); connStream.Add(dlg.TableName, etcon.ToXmlString()); _etconn = etcon; } }
public void ExplorerObjectDoubleClick(ExplorerObjectEventArgs e) { FormEventTableConnection dlg = new FormEventTableConnection(); if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ConfigConnections connStream = new ConfigConnections("eventtable", "546B0513-D71D-4490-9E27-94CD5D72C64A"); EventTableConnection etconn = new EventTableConnection( dlg.DbConnectionString, dlg.TableName, dlg.IdField, dlg.XField, dlg.YField, dlg.SpatialReference); string id = connStream.GetName(dlg.TableName); connStream.Add(id, etconn.ToXmlString()); e.NewExplorerObject = new EventTableObject(this.ParentExplorerObject, id, etconn); } }