private void frmMain_FormClosing(object sender, FormClosingEventArgs e) { if (MessageBox.Show("您确定要退出此系统吗?", "温馨提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button2) == DialogResult.OK) { WaitDialogForm waitDialogForm = new WaitDialogForm("正在保存当前状态......", "温馨提示"); List <Class_WindowType> class_WindowTypes = new List <Class_WindowType>(); foreach (XtraMdiTabPage xtra in xtraTabbedMdiManager1.Pages) { if (ActiveMDIForm.Tag != null) { Class_WindowType class_WindowType = new Class_WindowType(); class_WindowType = xtra.MdiChild.Tag as Class_WindowType; if (class_WindowType != null) { if (class_WindowType.XmlFileName == (ActiveMDIForm.Tag as Class_WindowType).XmlFileName) { class_WindowType.ActiveSign = true; } class_WindowTypes.Add(class_WindowType); } } } Class_SQLiteOperator class_SQLiteOperator = new Class_SQLiteOperator(); class_SQLiteOperator.SaveCurrentOpenWin(class_WindowTypes); waitDialogForm.Close(); waitDialogForm.Dispose(); e.Cancel = false; } else { e.Cancel = true; } }
private void Ini() { //this.textEdit1.Text = ""; //this.textEdit2.Text = ""; setIniSkin("Metropolis Dark"); this.Text = string.Format("登录 V {0}", this.version); class_SQLiteOperator = new Class_SQLiteOperator(); LogCount = 5; }
private void SetCompoment() { this.panelControl2.Visible = this.SelectDes; class_PublicMethod = new Class_PublicMethod(); this.Text += "---" + OperateType; memoEdit1.ReadOnly = true; GridC gridC = new GridC(); gridC.SetGridBar(this.gridControl1); gridC.SetGridBar(this.gridControl2); gridC.SetGridBar(this.gridControl3); gridC.SetGridBar(this.gridControl4); foreach (GridColumn grid in this.gridView1.Columns) { GridColumn gridColumn = new GridColumn(); gridColumn = grid; this.gridView2.Columns.Add(gridColumn); this.gridView3.Columns.Add(gridColumn); this.gridView4.Columns.Add(gridColumn); } GridViewC gridViewC = new GridViewC(); gridViewC.SetGridView(this.gridView1, true); gridViewC.SetGridView(this.gridView2, true); gridViewC.SetGridView(this.gridView3, true); gridViewC.SetGridView(this.gridView4, true); Class_SQLiteOperator class_SQLiteOperator = new Class_SQLiteOperator(); DataSet dataSet = new DataSet(); dataSet = class_SQLiteOperator.GetAllWindowInfomation(); this.gridControl1.DataSource = dataSet.Tables[0]; this.gridControl2.DataSource = dataSet.Tables[1]; this.gridControl3.DataSource = dataSet.Tables[2]; this.gridControl4.DataSource = dataSet.Tables[3]; this.xtraTabControl1.SelectedTabPageIndex = 0; this.gridView1.Focus(); Class_SystemDefault class_SystemDefaul = class_PublicMethod.FromXmlToSystemDefaultObject <Class_SystemDefault>(FileFullName); if (class_SystemDefaul != null) { this.xtraTabControl1.SelectedTabPageIndex = class_SystemDefaul.SelectOpenWindowIndex; } }
private void OpenHistoryWin() { List <Class_WindowType> class_WindowTypes = new List <Class_WindowType>(); Class_SQLiteOperator class_SQLiteOperator = new Class_SQLiteOperator(); class_WindowTypes = class_SQLiteOperator.GetWindowTypes(); this.barEditItem2.Visibility = BarItemVisibility.Always; if ((class_WindowTypes != null) && (class_WindowTypes.Count > 0)) { this.repositoryItemProgressBar2.Maximum = class_WindowTypes.Count; this.repositoryItemProgressBar2.Minimum = 0; Class_WindowType OpenPageTag = new Class_WindowType(); int Counter = 0; foreach (Class_WindowType class_WindowType in class_WindowTypes) { if (class_WindowType.ActiveSign) { OpenPageTag.XmlFileName = class_WindowType.XmlFileName; OpenPageTag.WindowType = class_WindowType.WindowType; OpenPageTag.ActiveSign = class_WindowType.ActiveSign; } switch (class_WindowType.WindowType) { case "select": OpenSelectWin(class_WindowType.XmlFileName); break; case "insert": OpenInsertWin(class_WindowType.XmlFileName); break; case "update": OpenUpdateWin(class_WindowType.XmlFileName); break; case "delete": OpenDeleteWin(class_WindowType.XmlFileName); break; case "welcome": openFirstPage(); break; default: OpenSelectWin(class_WindowType.XmlFileName); break; } this.barEditItem2.EditValue = (++Counter).ToString(); Thread.Sleep(0); Application.DoEvents(); } int num = -1; foreach (Form Children in this.MdiChildren) { num++; Class_WindowType ChildrenTag = new Class_WindowType() { XmlFileName = (Children.Tag as Class_WindowType).XmlFileName, WindowType = (Children.Tag as Class_WindowType).WindowType, }; if (ChildrenTag.XmlFileName.Equals(OpenPageTag.XmlFileName)) { Children.WindowState = FormWindowState.Maximized; Children.Select(); Children.BringToFront(); if (this.xtraTabbedMdiManager1.MdiParent != null) { this.xtraTabbedMdiManager1.Pages[Children].TabControl.ViewInfo.SelectedTabPageIndex = num; } break; } } } this.barEditItem2.Visibility = BarItemVisibility.Never; }