From 68062259d060308c2d25ed4d4f3f15afc9d0dc72 Mon Sep 17 00:00:00 2001 From: Falcon <12919280+falconfly@user.noreply.gitee.com> Date: Wed, 24 Jul 2024 17:32:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=98=BE=E7=A4=BA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CalendarNotepad/WorkMain.Designer.cs | 43 ++++++++++++++++++---------- CalendarNotepad/WorkMain.cs | 12 ++++++++ 2 files changed, 40 insertions(+), 15 deletions(-) diff --git a/CalendarNotepad/WorkMain.Designer.cs b/CalendarNotepad/WorkMain.Designer.cs index 38a2c9a..429a894 100644 --- a/CalendarNotepad/WorkMain.Designer.cs +++ b/CalendarNotepad/WorkMain.Designer.cs @@ -52,6 +52,8 @@ toolStrip1 = new ToolStrip(); tsp_Copy = new ToolStripButton(); tsb_palse = new ToolStripButton(); + toolStripSeparator1 = new ToolStripSeparator(); + tsb_loadin = new ToolStripButton(); FileListView = new ListView(); cms_FileList = new ContextMenuStrip(components); 删除ToolStripMenuItem = new ToolStripMenuItem(); @@ -70,8 +72,7 @@ panel2 = new Panel(); panel3 = new Panel(); OpenFileDlg = new OpenFileDialog(); - tsb_loadin = new ToolStripButton(); - toolStripSeparator1 = new ToolStripSeparator(); + lab_m_dbsize = new Label(); tabControl1.SuspendLayout(); tpWorkManage.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit(); @@ -383,6 +384,21 @@ tsb_palse.Text = "粘贴"; tsb_palse.Click += tsb_palse_Click; // + // toolStripSeparator1 + // + toolStripSeparator1.Name = "toolStripSeparator1"; + toolStripSeparator1.Size = new Size(6,25); + // + // tsb_loadin + // + tsb_loadin.DisplayStyle = ToolStripItemDisplayStyle.Text; + tsb_loadin.Image = (Image)resources.GetObject("tsb_loadin.Image"); + tsb_loadin.ImageTransparentColor = Color.Magenta; + tsb_loadin.Name = "tsb_loadin"; + tsb_loadin.Size = new Size(60,22); + tsb_loadin.Text = "导入附件"; + tsb_loadin.Click += tsb_loadin_Click; + // // FileListView // FileListView.ContextMenuStrip = cms_FileList; @@ -475,6 +491,7 @@ flowLayoutPanel3.AutoSize = true; flowLayoutPanel3.Controls.Add(bt_m_ys); flowLayoutPanel3.Controls.Add(label3); + flowLayoutPanel3.Controls.Add(lab_m_dbsize); flowLayoutPanel3.Dock = DockStyle.Top; flowLayoutPanel3.Location = new Point(3,42); flowLayoutPanel3.Name = "flowLayoutPanel3"; @@ -557,20 +574,15 @@ // OpenFileDlg.Multiselect = true; // - // tsb_loadin + // lab_m_dbsize // - tsb_loadin.DisplayStyle = ToolStripItemDisplayStyle.Text; - tsb_loadin.Image = (Image)resources.GetObject("tsb_loadin.Image"); - tsb_loadin.ImageTransparentColor = Color.Magenta; - tsb_loadin.Name = "tsb_loadin"; - tsb_loadin.Size = new Size(60,22); - tsb_loadin.Text = "导入附件"; - tsb_loadin.Click += tsb_loadin_Click; - // - // toolStripSeparator1 - // - toolStripSeparator1.Name = "toolStripSeparator1"; - toolStripSeparator1.Size = new Size(6,25); + lab_m_dbsize.AutoSize = true; + lab_m_dbsize.Font = new Font("微软雅黑",12F,FontStyle.Regular,GraphicsUnit.Point); + lab_m_dbsize.Location = new Point(361,5); + lab_m_dbsize.Name = "lab_m_dbsize"; + lab_m_dbsize.Size = new Size(42,21); + lab_m_dbsize.TabIndex = 2; + lab_m_dbsize.Text = "当前"; // // WorkMain // @@ -663,5 +675,6 @@ private SplitContainer splitContainer2; private ToolStripSeparator toolStripSeparator1; private ToolStripButton tsb_loadin; + private Label lab_m_dbsize; } } \ No newline at end of file diff --git a/CalendarNotepad/WorkMain.cs b/CalendarNotepad/WorkMain.cs index dce22ac..af283ea 100644 --- a/CalendarNotepad/WorkMain.cs +++ b/CalendarNotepad/WorkMain.cs @@ -102,6 +102,18 @@ namespace CalendarNotepad private void WorkMain_Load(object sender,EventArgs e) { mcWorkDay_DateChanged(sender,new DateRangeEventArgs(this.mcWorkDay.SelectionStart,this.mcWorkDay.SelectionEnd)); + Task.Factory.StartNew(() => { + try { + while(true) { + var size = new FileInfo(this.Db.SqliteDbfile).Length; + this.Invoke(() => { + this.lab_m_dbsize.Text = $"数据库大小({size})"; + }); + Task.Delay(TimeSpan.FromSeconds(1)); + } + } + catch(Exception) { } + }); } ///