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}); }
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; }
internal EntityDataSourceDataSelection(EntityDataSourceDataSelectionPanel panel, EntityDataSourceWizardForm wizard, EntityDataSourceDesignerHelper designerHelper, EntityDataSourceState entityDataSourceState) { _panel = panel; _panel.Register(this); _helper = designerHelper; _entityDataSourceState = entityDataSourceState; _wizardForm = wizard; }
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; } }
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; } }
// Copy properties from the data source to temporary state internal EntityDataSourceState LoadEntityDataSourceState() { EntityDataSourceState state = new EntityDataSourceState(); state.ConnectionString = this.EntityDataSource.ConnectionString; state.DefaultContainerName = this.EntityDataSource.DefaultContainerName; state.EnableDelete = this.EntityDataSource.EnableDelete; state.EnableInsert = this.EntityDataSource.EnableInsert; state.EnableUpdate = this.EntityDataSource.EnableUpdate; state.EntitySetName = this.EntityDataSource.EntitySetName; state.EntityTypeFilter = this.EntityDataSource.EntityTypeFilter; state.Select = this.EntityDataSource.Select; return state; }
// Copy properties from temporary state to the data source internal void SaveEntityDataSourceProperties(EntityDataSourceState state) { this.EntityDataSource.ConnectionString = state.ConnectionString; this.EntityDataSource.DefaultContainerName = state.DefaultContainerName; this.EntityDataSource.EnableDelete = state.EnableDelete; this.EntityDataSource.EnableInsert = state.EnableInsert; this.EntityDataSource.EnableUpdate = state.EnableUpdate; this.EntityDataSource.EntitySetName = state.EntitySetName; this.EntityDataSource.EntityTypeFilter = state.EntityTypeFilter; this.EntityDataSource.Select = state.Select; this.EntityDataSource.EnableFlattening = state.EnableFlattening; }