Exemple #1
0
        internal DeleteStorageEntitySetsDialog(ICollection <StorageEntitySet> storageEntitySets)
        {
            InitializeComponent();

            // Set the default font to VS shell font.
            var vsFont = VSHelpers.GetVSFont(Services.ServiceProvider);

            if (vsFont != null)
            {
                Font = vsFont;
                DescriptionLabel.Font = vsFont;
            }

            // default result is to cancel
            DialogResult = DialogResult.Cancel;

            // display StorageEntitySets ordered by name
            Debug.Assert(null != storageEntitySets, "Constructor requires a Collection of StorageEntitySets");
            if (null != storageEntitySets)
            {
                var entitySets = new List <StorageEntitySet>(storageEntitySets);
                entitySets.Sort(EFElement.EFElementDisplayNameComparison);
                StorageEntitySetsListBox.Items.AddRange(entitySets.ToArray());
                ViewUtils.DisplayHScrollOnListBoxIfNecessary(StorageEntitySetsListBox);
            }
            YesButton.BackColor = SystemColors.Control;
            YesButton.ForeColor = SystemColors.ControlText;
            NoButton.BackColor  = SystemColors.Control;
            NoButton.ForeColor  = SystemColors.ControlText;
            DeleteStorageEntitySetsDialogCancelButton.BackColor = SystemColors.Control;
            DeleteStorageEntitySetsDialogCancelButton.ForeColor = SystemColors.ControlText;
        }
Exemple #2
0
        internal ComplexTypePickerDialog(ConceptualEntityModel cModel)
        {
            InitializeComponent();

            // Set the default font to VS shell font.
            var vsFont = VSHelpers.GetVSFont(Services.ServiceProvider);

            if (vsFont != null)
            {
                Font = vsFont;
            }

            Debug.Assert(cModel != null, "Please specify ConceptualEntityModel");
            if (cModel != null)
            {
                var complexTypes = new List <ComplexType>(cModel.ComplexTypes());
                complexTypes.Sort(EFElement.EFElementDisplayNameComparison);
                complexTypesListBox.Items.AddRange(complexTypes.ToArray());
                ViewUtils.DisplayHScrollOnListBoxIfNecessary(complexTypesListBox);
            }

            complexTypesListBox.SelectedIndexChanged += complexTypesListBox_SelectedIndexChanged;
            complexTypesListBox.MouseDoubleClick     += complexTypesListBox_MouseDoubleClick;
            okButton.Enabled = ComplexType != null;
        }