增加显示数据库大小

This commit is contained in:
Falcon 2024-07-24 17:32:08 +08:00
parent 440970632c
commit 68062259d0
2 changed files with 40 additions and 15 deletions

View File

@ -52,6 +52,8 @@
toolStrip1 = new ToolStrip(); toolStrip1 = new ToolStrip();
tsp_Copy = new ToolStripButton(); tsp_Copy = new ToolStripButton();
tsb_palse = new ToolStripButton(); tsb_palse = new ToolStripButton();
toolStripSeparator1 = new ToolStripSeparator();
tsb_loadin = new ToolStripButton();
FileListView = new ListView(); FileListView = new ListView();
cms_FileList = new ContextMenuStrip(components); cms_FileList = new ContextMenuStrip(components);
ToolStripMenuItem = new ToolStripMenuItem(); ToolStripMenuItem = new ToolStripMenuItem();
@ -70,8 +72,7 @@
panel2 = new Panel(); panel2 = new Panel();
panel3 = new Panel(); panel3 = new Panel();
OpenFileDlg = new OpenFileDialog(); OpenFileDlg = new OpenFileDialog();
tsb_loadin = new ToolStripButton(); lab_m_dbsize = new Label();
toolStripSeparator1 = new ToolStripSeparator();
tabControl1.SuspendLayout(); tabControl1.SuspendLayout();
tpWorkManage.SuspendLayout(); tpWorkManage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit(); ((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit();
@ -383,6 +384,21 @@
tsb_palse.Text = "粘贴"; tsb_palse.Text = "粘贴";
tsb_palse.Click += tsb_palse_Click; 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
// //
FileListView.ContextMenuStrip = cms_FileList; FileListView.ContextMenuStrip = cms_FileList;
@ -475,6 +491,7 @@
flowLayoutPanel3.AutoSize = true; flowLayoutPanel3.AutoSize = true;
flowLayoutPanel3.Controls.Add(bt_m_ys); flowLayoutPanel3.Controls.Add(bt_m_ys);
flowLayoutPanel3.Controls.Add(label3); flowLayoutPanel3.Controls.Add(label3);
flowLayoutPanel3.Controls.Add(lab_m_dbsize);
flowLayoutPanel3.Dock = DockStyle.Top; flowLayoutPanel3.Dock = DockStyle.Top;
flowLayoutPanel3.Location = new Point(3,42); flowLayoutPanel3.Location = new Point(3,42);
flowLayoutPanel3.Name = "flowLayoutPanel3"; flowLayoutPanel3.Name = "flowLayoutPanel3";
@ -557,20 +574,15 @@
// //
OpenFileDlg.Multiselect = true; OpenFileDlg.Multiselect = true;
// //
// tsb_loadin // lab_m_dbsize
// //
tsb_loadin.DisplayStyle = ToolStripItemDisplayStyle.Text; lab_m_dbsize.AutoSize = true;
tsb_loadin.Image = (Image)resources.GetObject("tsb_loadin.Image"); lab_m_dbsize.Font = new Font("微软雅黑",12F,FontStyle.Regular,GraphicsUnit.Point);
tsb_loadin.ImageTransparentColor = Color.Magenta; lab_m_dbsize.Location = new Point(361,5);
tsb_loadin.Name = "tsb_loadin"; lab_m_dbsize.Name = "lab_m_dbsize";
tsb_loadin.Size = new Size(60,22); lab_m_dbsize.Size = new Size(42,21);
tsb_loadin.Text = "导入附件"; lab_m_dbsize.TabIndex = 2;
tsb_loadin.Click += tsb_loadin_Click; lab_m_dbsize.Text = "当前";
//
// toolStripSeparator1
//
toolStripSeparator1.Name = "toolStripSeparator1";
toolStripSeparator1.Size = new Size(6,25);
// //
// WorkMain // WorkMain
// //
@ -663,5 +675,6 @@
private SplitContainer splitContainer2; private SplitContainer splitContainer2;
private ToolStripSeparator toolStripSeparator1; private ToolStripSeparator toolStripSeparator1;
private ToolStripButton tsb_loadin; private ToolStripButton tsb_loadin;
private Label lab_m_dbsize;
} }
} }

View File

@ -102,6 +102,18 @@ namespace CalendarNotepad
private void WorkMain_Load(object sender,EventArgs e) { private void WorkMain_Load(object sender,EventArgs e) {
mcWorkDay_DateChanged(sender,new DateRangeEventArgs(this.mcWorkDay.SelectionStart,this.mcWorkDay.SelectionEnd)); 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) { }
});
} }
/// <summary> /// <summary>