public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { // We can only get a list of possible EntityTypeFilter values if we have: // (1) Connection string so we can load metadata // (2) DefaultContainerName to give scope to the lookup // (3) EntitySetName that exists in DefaultContainerName so we can get its type and derived types // Even if these values are set, it may not be possible to actually find them in metadata, but at least we can try the lookup if requested EntityDataSource entityDataSource = context.Instance as EntityDataSource; if (entityDataSource != null && !String.IsNullOrEmpty(entityDataSource.ConnectionString) && !String.IsNullOrEmpty(entityDataSource.DefaultContainerName) && !String.IsNullOrEmpty(entityDataSource.EntitySetName)) { List<EntityDataSourceEntityTypeFilterItem> entityTypeFilterItems = new EntityDataSourceDesignerHelper(entityDataSource, false /*interactiveMode*/).GetEntityTypeFilters( entityDataSource.DefaultContainerName, entityDataSource.EntitySetName); string[] entityTypeFilters = new string[entityTypeFilterItems.Count]; for (int i = 0; i < entityTypeFilterItems.Count; i++) { entityTypeFilters[i] = entityTypeFilterItems[i].EntityTypeName; } return new StandardValuesCollection(entityTypeFilters); } return null; }
public EntityDataSourceWizardForm(IServiceProvider serviceProvider, EntityDataSourceState entityDataSourceState, EntityDataSourceDesigner entityDataSourceDesigner) : base(serviceProvider) { _entityDataSourceState = entityDataSourceState; this.SetGlyph(new Bitmap(BitmapSelector.GetResourceStream(typeof(EntityDataSourceWizardForm), "EntityDataSourceWizard.bmp"))); this.Text = String.Format(CultureInfo.InvariantCulture, Strings.Wizard_Caption(((EntityDataSource)entityDataSourceDesigner.Component).ID)); _helper = entityDataSourceDesigner.Helper; EntityDataSourceConfigureObjectContextPanel contextPanel = new EntityDataSourceConfigureObjectContextPanel(); _configureContext = new EntityDataSourceConfigureObjectContext(contextPanel, this, entityDataSourceDesigner.Helper, _entityDataSourceState); EntityDataSourceDataSelectionPanel dataPanel = new EntityDataSourceDataSelectionPanel(); _configureDataSelection = new EntityDataSourceDataSelection(dataPanel, this, entityDataSourceDesigner.Helper, _entityDataSourceState); _configureContext.ContainerNameChanged += _configureDataSelection.ContainerNameChangedHandler; _configureContext.LoadState(); _configureDataSelection.LoadState(); // Adds the panels to the wizard SetPanels(new WizardPanel[] { contextPanel, dataPanel}); }
internal EntityDataSourceDataSelection(EntityDataSourceDataSelectionPanel panel, EntityDataSourceWizardForm wizard, EntityDataSourceDesignerHelper designerHelper, EntityDataSourceState entityDataSourceState) { _panel = panel; _panel.Register(this); _helper = designerHelper; _entityDataSourceState = entityDataSourceState; _wizardForm = wizard; }
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { // We can only get a list of possible DefaultContainerName values if we have: // (1) Connection string so we can load metadata // Even if this value is set, it may not be possible to actually load the metadata, but at least we can try the lookup if requested EntityDataSource entityDataSource = context.Instance as EntityDataSource; if (entityDataSource != null && !String.IsNullOrEmpty(entityDataSource.ConnectionString)) { List<EntityDataSourceContainerNameItem> containerNameItems = new EntityDataSourceDesignerHelper(entityDataSource, false /*interactiveMode*/).GetContainerNames(true /*sortResults*/); string[] containers = new string[containerNameItems.Count]; for (int i = 0; i < containerNameItems.Count; i++) { containers[i] = containerNameItems[i].ToString(); } return new StandardValuesCollection(containers); } return null; }
internal EntityDataSourceConfigureObjectContext(EntityDataSourceConfigureObjectContextPanel panel, EntityDataSourceWizardForm wizardForm, EntityDataSourceDesignerHelper helper, EntityDataSourceState entityDataSourceState) { try { Cursor.Current = Cursors.WaitCursor; _panel = panel; _helper = helper; // Explicitly load metadata here to ensure that we get the latest changes in the project _helper.ReloadResources(); _panel.Register(this); _wizardForm = wizardForm; _entityDataSourceState = entityDataSourceState; } finally { Cursor.Current = Cursors.Default; } }
public override void Initialize(IComponent component) { base.Initialize(component); _helper = new EntityDataSourceDesignerHelper(component as EntityDataSource, true /*interactiveMode*/); _helper.AddSystemWebEntityReference(); }
public EntityDesignerDataSourceView(EntityDataSourceDesigner owner) : base(owner, EntityDataSourceDesignerHelper.DefaultViewName) { _helper = owner.Helper; }