Skip to content

Commit

Permalink
11
Browse files Browse the repository at this point in the history
  • Loading branch information
OverTM committed Jan 12, 2020
1 parent b569cdb commit a0bc0c6
Show file tree
Hide file tree
Showing 14 changed files with 1,592 additions and 9 deletions.
152 changes: 152 additions & 0 deletions WorkTimeRecord/Forms/MainMenu.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 78 additions & 0 deletions WorkTimeRecord/Forms/MainMenu.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using Utility;
using Get;
using System.Windows.Forms;

namespace WorkTimeRecord
{
public partial class MainMenu : Form
{
public MainMenu()
{
GlobalVariables.StartWorkTime = Settings.Default.StartWorkTime == "" ? "Not found" : Settings.Default.StartWorkTime;
InitializeComponent();
}

private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}

private void 设置log路径ToolStripMenuItem_Click(object sender, EventArgs e)
{
SettingsForm settingsForm = new SettingsForm();
settingsForm.ShowDialog();
}

private void notifyIcon_MouseClick(object sender, MouseEventArgs e)
{
this.Visible = true;
this.WindowState = FormWindowState.Normal;
this.Activate();
}

private void MainMenu_Load(object sender, EventArgs e)
{
if (Settings.Default.isFirstStart)
{
Settings.Default.isFirstStart = false;
Settings.Default.Save();
MessageBox.Show("需要先文件保存路径才能使用");
FileOperations.SelectFolder();
}
else
{
GlobalVariables.SavePath = Settings.Default.SavePath;
}
this.Top = int.Parse(GlobalVariables.MainLocationY);
this.Left = int.Parse(GlobalVariables.MainLocationX);
}

private void MainMenu_FormClosing(object sender, FormClosingEventArgs e)
{
Settings.Default.isFirstStart = GlobalVariables.isFirstStart;
Settings.Default.StartWorkTime = GlobalVariables.StartWorkTime;
Settings.Default.SavePath = GlobalVariables.SavePath;
Settings.Default.Save();
}

private void 本机时间ToolStripMenuItem_Click(object sender, EventArgs e)
{
GlobalVariables.isLocalTime = true;
(sender as ToolStripMenuItem).Checked = true;
网络时间ToolStripMenuItem.Checked = false;
}

private void 网络时间ToolStripMenuItem_Click(object sender, EventArgs e)
{
GlobalVariables.isLocalTime = false;
(sender as ToolStripMenuItem).Checked = true;
本机时间ToolStripMenuItem.Checked = false;
}
}
}
Loading

0 comments on commit a0bc0c6

Please sign in to comment.