Beispiel #1
0
        private void removeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (var selectedRow in dataGridViewProperties.SelectedRows)
            {
                DataGridViewRow row = selectedRow as DataGridViewRow;

                var properties = from a in _properties
                                 where a.Id == row.Cells[0].Value.ToString()
                                 select a;
                IsWiXProperty iswixProperty = properties.First();
                iswixProperty.Delete();
                _properties.Remove(iswixProperty);

                try
                {
                    string propertyId = row.Cells[0].Value.ToString();

                    dataGridViewProperties.Rows.Remove(row);
                }
                catch (Exception)
                {
                }
            }
            CommitChanges();
        }
Beispiel #2
0
        public void Remove(PropertyModel selectedItem)
        {
            IsWiXProperty iswixProperty = _iswixProperties.First(s => s.Id == selectedItem.Id);

            iswixProperty.Delete();
            Properties.Remove(selectedItem);
        }