private void removePropertyBtn_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Are you sure you want to remove the selected Property?", "Remove Property", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                propertyMapControl.PropertyMap.MappedProperties.Remove(propertyMapControl.SelectedProperty);

                if (AddedMappedProperties.Contains(propertyMapControl.SelectedProperty))
                {
                    AddedMappedProperties.Remove(propertyMapControl.SelectedProperty);
                }
                else
                {
                    DeletedMappedProperties.Add(propertyMapControl.SelectedProperty);
                }

                propertyMapControl.Map();
            }
        }
Exemplo n.º 2
0
        private void RemoveCustomMappedPropertyFromMap(MappedProperty mappedProperty, PropertyMap map)
        {
            if (!mappedProperty.IsCustom)
            {
                return;
            }

            if (MessageBox.Show("Are you sure you want to remove the selected Property?", "Remove Property", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            {
                return;
            }

            try
            {
                this.Cursor = Cursors.WaitCursor;

                map.MappedProperties.Remove(mappedProperty);

                if (AddedMappedProperties.Contains(mappedProperty))
                {
                    AddedMappedProperties.Remove(mappedProperty);
                }
                else
                {
                    DeletedMappedProperties.Add(mappedProperty);
                }

                PopulateRequestList();
                PopulateResponseList();
                PopulateContextMenu();
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Default;
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }