private void btnEdit_Click(object sender, EventArgs e) { if (!(lstJoins.SelectedItem is FeatureLayerJoinItem)) { return; } IFeatureLayerJoin join = ((FeatureLayerJoinItem)lstJoins.SelectedItem).FeatureLayerJoin; AddJoinDialog dlg = new AddJoinDialog(_mapDocument, _layer); dlg.FeatureLayerJoin = join; if (dlg.ShowDialog() == DialogResult.OK) { IFeatureLayerJoin newJoin = dlg.FeatureLayerJoin; if (newJoin != null) { _layer.Joins.Remove(join); _layer.Joins.Add(newJoin); _layer.FirePropertyChanged(); FillList(); } } }
private void btnAdd_Click(object sender, EventArgs e) { AddJoinDialog dlg = new AddJoinDialog(_mapDocument, _layer); if (dlg.ShowDialog() == DialogResult.OK) { IFeatureLayerJoin join = dlg.FeatureLayerJoin; if (join != null) { if (_layer.Joins == null) { _layer.Joins = new Framework.Data.FeatureLayerJoins(); } _layer.Joins.Add(join); _layer.FirePropertyChanged(); FillList(); } } }