Skip to content

Commit

Permalink
boot startup시 화면이 보이지 않도록 하는 기능 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
mijien0179 committed Jun 5, 2022
1 parent a717574 commit 7d1a3b9
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 81 deletions.
20 changes: 15 additions & 5 deletions pctory/Form1.Designer.cs

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

52 changes: 10 additions & 42 deletions pctory/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,10 @@ namespace pctory
{
public partial class Form1 : pctoryForm
{
string[] args;

bool closer = false;

Tracer tracer = null;
Thread thread;
DayTrace daytrace=null;
private bool running = false;

private void textUpdate()
{

while (running)
{
InvalidateText();
Thread.Sleep(3000);
}
}

private void InvalidateText()
{
Expand All @@ -48,16 +34,21 @@ private void InvalidateText()

dataGridView1.Rows.Clear();
dataGridView1.Rows.AddRange(viewInitializer.ProcInfoList2DVGRows(tracer.ProcInfoList));

Application.ApplicationExit += (sender, e) =>
{
closer = true;
tracer.StopTrace();
};
}
public Form1(string[] args)
public Form1()
{
InitializeComponent();
InitializeFileDialog();


Tag = TitleBarColor;

this.args = args;

tracer = new Tracer(true);

Expand All @@ -70,12 +61,10 @@ public Form1(string[] args)

private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
Hide();
if (!closer) e.Cancel = true;
else FileAutoOutput_Closing(sender, e);

running = false;
thread.Abort();
Hide();
}

private void tsmiTracerRun_Click(object sender, EventArgs e)
Expand All @@ -84,7 +73,6 @@ private void tsmiTracerRun_Click(object sender, EventArgs e)
{
tsmiTracerRun.Text = "트레이서 재동작";

running = false;
tracer.StopTrace();


Expand All @@ -107,10 +95,6 @@ private void tsmiTracerRun_Click(object sender, EventArgs e)

tracer.RunTrace();

running = true;
thread = new Thread(textUpdate);
thread.Start();

TitleBarColor = (Color[])Tag;


Expand All @@ -128,19 +112,6 @@ private void 설정OToolStripMenuItem_Click(object sender, EventArgs e)

private void Form1_Load(object sender, EventArgs e)
{
running = true;
thread = new Thread(textUpdate);
thread.Start();

if (args.Contains("--autorun"))
{
Visible = false;

args = (from d in args
where d != "--autorun"
select d).ToArray();
}

}

private void InitializeFileDialog()
Expand Down Expand Up @@ -177,7 +148,7 @@ private void 종료ToolStripMenuItem_Click(object sender, EventArgs e)
tracer.StopTrace();
daytrace.Stop();

Close();
Application.Exit();
}

private void noti_MouseDoubleClick(object sender, MouseEventArgs e)
Expand All @@ -188,9 +159,6 @@ private void noti_MouseDoubleClick(object sender, MouseEventArgs e)
private void OpenForm()
{
Show();
running = true;
thread = new Thread(textUpdate);
thread.Start();
}

private void 열기ToolStripMenuItem_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -313,7 +281,7 @@ private void 현재통계보기ToolStripMenuItem_Click(object sender, EventArgs
private void Form1_Activated(object sender, EventArgs e)
{
tracer.LogBackgroundTime2LastPCB();

InvalidateText();

}
}
Expand Down
11 changes: 10 additions & 1 deletion pctory/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,16 @@ static void Main(string[] args)
return;
}

Application.Run(new Form1(args));
Form frm = new Form1();
if(args.Length > 0 && args[0] == "--autorun")
{
Application.Run();
}
else
{
Application.Run(frm);
}

mutex.Close();

}
Expand Down
71 changes: 38 additions & 33 deletions pctory/fViewer.Designer.cs

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

0 comments on commit 7d1a3b9

Please sign in to comment.