private void PropertyModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { NamespaceModel namespaceModel = sender as NamespaceModel; if (namespaceModel.Selected) { _iswixNamespaces.Add(namespaceModel.Prefix, namespaceModel.Uri); } else { _iswixNamespaces.Remove(namespaceModel.Prefix); } }
private void dataGridViewNamespaces_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if ((bool)dataGridViewNamespaces.CurrentCell.Value) { string name = dataGridViewNamespaces.CurrentRow.Cells[1].Value.ToString(); string uri = dataGridViewNamespaces.CurrentRow.Cells[2].Value.ToString(); _namespaces.Add(name, uri); } else { string name = dataGridViewNamespaces.CurrentRow.Cells[1].Value.ToString(); _namespaces.Remove(name); } }