Beispiel #1
0
        private void PersistentTypeComboSelectionChanged(object sender, EventArgs e)
        {
            IconComboBox comboBox = (sender as IconComboBox);

            if (disableComboChangeNotification[comboBox])
            {
                return;
            }

            bool isPersistentCombo = (sender as Control).Tag == "0";

            if (!isPersistentCombo)
            {
                PersistentTypeItem selectedPersistentType = SelectedPersistentType;
                PersistentTypeItem selectedPropertyType   = SelectedPropertyType;
                bool isItself = false;
                if (selectedPersistentType != null && selectedPropertyType != null)
                {
                    isItself = selectedPersistentType.EqualsTo(selectedPropertyType);
                }

                chNavigationToItSelf.Checked = isItself;
            }
            UpdateControlNavigationToItSelf();
            UpdatePreview();
            GenerateAssociationName();
            GeneratePropertyNames();
        }
Beispiel #2
0
        private int FindPersistentTypeIndex(IconComboBox combo, PersistentTypeItem persistentTypeItem)
        {
            int idx = -1;

            foreach (var entry in combo.Items.OfType <IconListEntry>())
            {
                idx++;
                PersistentTypeItem item = entry.Value as PersistentTypeItem;
                if (item.EqualsTo(persistentTypeItem))
                {
                    break;
                }
            }

            return(idx);
        }
Beispiel #3
0
        private void SelectPersistentType(IconComboBox comboBox, PersistentTypeItem itemToSelect)
        {
            int idx = 0;

            foreach (var entry in comboBox.Items.OfType <IconListEntry>())
            {
                PersistentTypeItem item = entry.Value as PersistentTypeItem;
                if (item.EqualsTo(itemToSelect))
                {
                    comboBox.SelectedIndex = idx;
                    break;
                }

                idx++;
            }
        }
Beispiel #4
0
        private void SelectPersistentType(bool end1, PersistentTypeItem typeToSelect)
        {
            var combo = GetPersistentTypeCombo(end1);
            int idx   = 0;

            foreach (var entry in combo.Items.OfType <IconListEntry>())
            {
                PersistentTypeItem item = entry.Value as PersistentTypeItem;
                if (item.EqualsTo(typeToSelect))
                {
                    combo.SelectedIndex = idx;
                    break;
                }

                idx++;
            }
        }
Beispiel #5
0
        private void chNavigationToItSelf_CheckedChanged(object sender, EventArgs e)
        {
            PersistentTypeItem selectedPersistentType = SelectedPersistentType;
            PersistentTypeItem selectedPropertyType   = SelectedPropertyType;

            bool isItself = false;

            if (selectedPersistentType != null && selectedPropertyType != null)
            {
                isItself = selectedPersistentType.EqualsTo(selectedPropertyType);
            }

            if (chNavigationToItSelf.Checked && !isItself)
            {
                SelectPersistentType(cmbPropertyTypes, selectedPersistentType);
            }

            UpdateControlNavigationToItSelf();
            UpdatePreview();
        }