private void btnCreateProperty_Click(object sender, EventArgs e) { Dictionary <string, object> searchProp = new Dictionary <string, object>(); searchProp.Add("Application.Id", BackendApplication.Id); searchProp.Add("Name", "CustomProperties"); IList <BusinessEntity> beList = modelService.GetAllDomainObjectsByPropertyValues <BusinessEntity>(searchProp); if (beList.Count > 0) { using (CreatePropertyForm createPropertyForm = new CreatePropertyForm(beList[0])) { if (createPropertyForm.ShowDialog() == DialogResult.OK) { if (SelectedPropertyList == null) { SelectedPropertyList = new List <Property>(); } // Add the property to selected list and set as selected property SelectedPropertyList.Add(createPropertyForm.Property); this.SelectedProperty = createPropertyForm.Property; DialogResult = DialogResult.OK; } } } }
private void okBtn_Click(object sender, EventArgs e) { if (propertyListView.SelectedItems.Count > 0) { if (SelectedPropertyList == null) { SelectedPropertyList = new List <Property>(); } if (SearchedMappedProperty) { foreach (ListViewItem item in propertyListView.SelectedItems) { SelectedPropertyList.Add((Property)(item.Tag as MappedProperty).Target); } this.SelectedProperty = (Property)(propertyListView.SelectedItems[0].Tag as MappedProperty).Target; } else { foreach (ListViewItem item in propertyListView.SelectedItems) { SelectedPropertyList.Add(item.Tag as Property); } this.SelectedProperty = propertyListView.SelectedItems[0].Tag as Property; } DialogResult = DialogResult.OK; Close(); } }