public void AddNewTable() { var dialog = new AddTableDialog(); int tablesCount = TableDatas.Count; dialog.Init(this, _view, GetRandomTableName()); dialog.ShowDialog(); var result = dialog.Result; if (result.Success) { var tableForm = new TableForm(); tableForm.Init( result.Value, _form.TableForm_FormClosed, _form.TableForm_ModelChanged); tableForm.MdiParent = _form; TableDatas.Add(TableData.Get(tableForm)); _view.AddTableButton(result.Value.Name); _form.IsFileSaved = false; tableForm.Show(); } }
private void button6_Click(object sender, EventArgs e) { TableForm form = TableForm.Instance; form.TopLevel = false; this.contentPanel.Controls.Clear(); this.contentPanel.Controls.Add(form); form.Dock = DockStyle.Fill; form.Show(); }
/* * Создание и открытие окна таблицы, TableData которой уже есть в MainModel */ public void AddExistingTable(TableData tableData) { TableForm tableForm = new TableForm(); tableForm.Init( tableData, _form.TableForm_FormClosed, _form.TableForm_ModelChanged); tableForm.MdiParent = _form; tableForm.Show(); }
/// <summary> /// 加载窗体 /// </summary> private void InitForm() { string dbserver = string.Empty; if (dao_table.GetDBcon().dbType == Sephiroth.Infrastructure.DataPersistence.Dapper.DBcon.dbtype.Oracle) { dbserver = ConfigurationManager.AppSettings["dbserver"].ToString(); } var tablename = dao_table.GetThisAllTable(dbserver); var items = tablename.OrderBy(x => x.TABLE_NAME) .Select(x => { var nbi = new NavBarItemLink(new NavBarItem { Name = x.TABLE_NAME, Caption = x.TABLE_NAME, }); nbi.Item.LinkClicked += (send, e) => { //判断当前页面是否已经打开 var pindex = this.xtraTabbedMdiManager1.Pages.FirstOrDefault(page => x.TABLE_NAME.Equals(page.Text)); //选中 if (pindex != null) { this.xtraTabbedMdiManager1.SelectedPage = pindex; return; } //创建新页面 TableForm doc = new TableForm(x); doc.Text = x.TABLE_NAME; doc.WindowState = FormWindowState.Maximized; doc.MdiParent = this; doc.Show(); }; return(nbi); }).ToArray(); this.nbg_table.ItemLinks.AddRange(items); }
private void openExcelFile_FileOk(object sender, CancelEventArgs e) { TableForm table = new TableForm(openExcelFile.FileName); table.Show(); }
private void showTableButton_Click(object sender, EventArgs e) { TableForm tableForm = new TableForm(records); tableForm.Show(); }
/// <summary> /// Opens a TableForm based on the path to a Index or StringsFile. /// </summary> /// <param name="filePath">Path to the Index or StringsFile.</param> private void _OpenIndexFile(String filePath) { TableForm tableForm; PackFile packFile; if (filePath.EndsWith(IndexFile.Extension)) { packFile = new IndexFile(filePath); } else { packFile = new HellgatePackFile(filePath); } // Check if the form is already open. // If true, then activate the form. bool isOpen = _openTableForms.Where(tf => tf.FilePath == filePath).Any(); if (isOpen) { tableForm = _openTableForms.Where(tf => tf.FilePath == filePath).First(); if (tableForm.Created) { tableForm.Select(); return; } } // Try read the file. // If an exception is caught, log the error and inform the user. byte[] buffer; try { buffer = File.ReadAllBytes(filePath); } catch (Exception ex) { ExceptionLogger.LogException(ex, false); return; } // parse file try { packFile.ParseFileBytes(buffer); } catch (Exception ex) { ExceptionLogger.LogException(ex, false); return; } tableForm = new TableForm(packFile) { MdiParent = this, Text = Text + ": " + packFile.Path }; if (!_openTableForms.Contains(tableForm)) _openTableForms.Add(tableForm); tableForm.Show(); }
private void button9_Click(object sender, EventArgs e) { goodToForm.Clear(); if (dateTimePicker2.Value.Ticks <= dateTimePicker3.Value.Ticks) { foreach (Good good in Goodsmanager.Goods) { if ((good.DateStart.Ticks >= dateTimePicker2.Value.Ticks && good.DateStart.Ticks <= dateTimePicker3.Value.Ticks) || (good.DateFinish.Ticks >= dateTimePicker2.Value.Ticks && good.DateFinish.Ticks <= dateTimePicker3.Value.Ticks) || (good.DateFinish.Ticks >= dateTimePicker3.Value.Ticks && good.DateStart.Ticks <= dateTimePicker2.Value.Ticks)) { goodToForm.Add(good); } else { if (good.DateFinish.Ticks < dateTimePicker2.Value.Ticks) { long elapsedSpan = dateTimePicker2.Value.Ticks - good.DateFinish.Ticks; TimeSpan tS = new TimeSpan(elapsedSpan); if (good.Fine >= (good.Width / 25) * (good.Height / 25) * 10 * tS.Days) goodToForm.Add(good); } } } TableForm tableForm = new TableForm(); tableForm.Show(this); } }
private void TableFormInit() { tableForm = new TableForm(); tableForm.MdiParent = this; tableForm.Show(); }
private void tasksViewToolStripMenuItem_Click(object sender, EventArgs e) { tableForm.Show(); }