private void tsbSave_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; switch (tabControl1.SelectedIndex) { case 2: SreDataSourceProperty.KeepVersion(this.DataSource.Id); this.idpeKeys1.Save(); break; case 3: SreDataSourceProperty.KeepVersion(this.DataSource.Id); this.sreEmails1.Save(); break; case 4: SreDataSourceProperty.KeepVersion(this.DataSource.Id); this.sreDatabases1.Save(); break; } if (propertyGrid.SelectedObject is SreAttributeProperty) { SreAttributeProperty aProp = propertyGrid.SelectedObject as SreAttributeProperty; if ((aProp != null) && (aProp.HasChanged == true)) { MainWindow.SetToolStripStatusLabel("Please wait...Saving..."); Application.DoEvents(); aProp.Save(); aProp.HasChanged = false; errorProvider1.Clear(); DockPanelGlobalAttributes.RefreshData(aProp.Attribute.AttributeId); } } else if (propertyGrid.SelectedObject is SreDataSourceProperty) { SreDataSourceProperty dsProp = propertyGrid.SelectedObject as SreDataSourceProperty; if ((dsProp != null) && (dsProp.HasChanged == true)) { string errorMsg = errorProvider1.GetError(picIcon); if ((errorMsg.StartsWith("Property has been changed, will be auto saved")) || (string.IsNullOrEmpty(errorProvider1.GetError(picIcon)))) { MainWindow.SetToolStripStatusLabel("Please wait...Saving..."); Application.DoEvents(); dsProp.Save(); dsProp.HasChanged = false; errorProvider1.Clear(); DockPanelDataSources.RefreshData(dsProp.DataSource.Id); } } } tsbClearCache_Click(sender, e); }
public void OpenDataSourceWindow() { //if (GetSchema()) // return; if (m_dm_GlobalAttributes != null) //already open { return; } dockPanel.Visible = false; dockPanel.SuspendLayout(true); CloseOtherWindows(); m_dm_GlobalAttributes = new DockPanelGlobalAttributes(); m_dm_GlobalAttributes.CloseButtonVisible = false; m_dm_GlobalAttributes.sreListView1.ItemSelectedIndexChanged += new EventHandler(OnAttributeChanged); m_dm_GlobalAttributes.sreListView1.AddButtonClick += new EventHandler(OnAttributeAddButtonClicked); m_dm_GlobalAttributes.sreListView1.PrintButtonClick += new EventHandler(OnAttributePrintButtonClicked); m_dm_GlobalAttributes.Show(dockPanel, DockState.DockLeftAutoHide); m_dm_DataSources = new DockPanelDataSources(); m_dm_DataSources.sreListView1.ItemSelectedIndexChanged += new EventHandler(OnDataSourceChanged); m_dm_DataSources.sreListView1.AddButtonClick += new EventHandler(OnDataSourceAddButtonClicked); m_dm_DataSources.sreListView1.PrintButtonClick += new EventHandler(OnDataSourcePrintButtonClicked); m_dm_DataSources.CloseButtonVisible = false; m_dm_DataSources.Show(dockPanel, DockState.Document); m_Rules = new Rules(); m_Rules.CloseButtonVisible = false; m_Rules.Show(dockPanel, DockState.DockLeftAutoHide); m_Rules.AutoHidePortion = 0.50; m_Monitor = new Monitor(); m_Monitor.CloseButtonVisible = false; m_Monitor.Show(dockPanel, DockState.DockRightAutoHide); m_Monitor.AutoHidePortion = 0.5; m_FileLog = new FileLog(); m_FileLog.CloseButtonVisible = false; m_FileLog.Show(dockPanel, DockState.DockBottomAutoHide); m_FileLog.AutoHidePortion = 0.965; m_EmailLog = new EmailLogs(); m_EmailLog.CloseButtonVisible = false; m_EmailLog.Show(dockPanel, DockState.DockRightAutoHide); m_EmailLog.AutoHidePortion = 0.5; m_Rules_Editor = new RuleEditor.MainWindow(new IdpeRule(), Common.RuleSetTypes.RowPreparing); m_dm_Property = new DockPanelProperty(); m_dm_Property.CloseButtonVisible = false; m_dm_Property.MainWindow = this; m_dm_Property.Show(m_dm_DataSources.Pane, DockAlignment.Right, 0.5); m_dm_Attributes = new DockPanelDataSourceAttributes(); m_dm_Attributes.sreListView1.ItemSelectedIndexChanged += new EventHandler(OnAttributeChanged); m_dm_Attributes.sreListView1.Repositioned += new EventHandler(OnAttributeRepositioned); m_dm_Attributes.sreListView1.DeleteKeyPressed += new EventHandler(OnAttributeDelete); m_dm_Attributes.CloseButtonVisible = false; m_dm_Attributes.MainWindow = this; m_dm_SystemAttributes = new DockPanelDataSourceSystemAttributes(); m_dm_SystemAttributes.sreListView1.ItemSelectedIndexChanged += new EventHandler(OnAttributeChanged); m_dm_SystemAttributes.sreListView1.Repositioned += new EventHandler(OnAttributeRepositioned); m_dm_SystemAttributes.sreListView1.DeleteKeyPressed += new EventHandler(OnAttributeDelete); m_dm_SystemAttributes.CloseButtonVisible = false; m_dm_SystemAttributes.MainWindow = this; m_dm_Mapper = new DockPanelMapper(); m_dm_Mapper.CloseButtonVisible = false; m_dm_Attributes.Show(m_dm_DataSources.Pane, DockAlignment.Bottom, 0.65); m_dm_SystemAttributes.Show(m_dm_Attributes.Pane, DockAlignment.Right, 0.45); m_dm_Mapper.Show(m_dm_Attributes.Pane, DockAlignment.Right, 0.2); if (m_dm_DataSources.sreListView1.ListView.Items.Count > 0) { m_dm_DataSources.sreListView1.ListView.Items[0].Selected = true; } m_dm_DataSources.Activate(); dockPanel.ResumeLayout(true, true); dockPanel.Visible = true; }