-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from andreaskueffel/development
Add RememberLastSync property to improve performance
- Loading branch information
Showing
17 changed files
with
717 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -398,3 +398,4 @@ FodyWeavers.xsd | |
*.sln.iml | ||
/*.sln | ||
/FileSyncLibNet/FileSyncLibNet.sln | ||
/FileSyncAppWin/pub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>net6.0-windows</TargetFramework> | ||
|
||
<UseWindowsForms>true</UseWindowsForms> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\FileSyncApp\FileSyncApp.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
using FileSyncLibNet.Commons; | ||
|
||
namespace FileSyncAppWin | ||
{ | ||
public partial class MainForm : Form | ||
{ | ||
Thread consoleThread; | ||
|
||
public MainForm() | ||
{ | ||
InitializeComponent(); | ||
this.FormClosing += (s, e) => { FileSyncApp.Program.keepRunning = false; consoleThread?.Join(10_000); }; | ||
consoleThread = new Thread(() => | ||
{ | ||
FileSyncApp.Program.Main(null); | ||
}); | ||
FileSyncApp.Program.JobsReady += (s,e)=> { | ||
foreach(var job in FileSyncApp.Program.Jobs) | ||
{ | ||
job.Value.JobStarted += (j, text) => | ||
{ | ||
NewLogOutput($"{job.Key} STARTED - {text.Status} {text.Exception}"); | ||
}; | ||
job.Value.JobFinished += (j, text) => | ||
{ | ||
NewLogOutput($"{job.Key} FINISHED - {text.Status} {text.Exception}"); | ||
}; | ||
job.Value.JobError += (j, text) => | ||
{ | ||
NewLogOutput($"{job.Key} ERROR - {text.Status} {text.Exception}"); | ||
}; | ||
} | ||
}; | ||
consoleThread.Start(); | ||
this.Resize += ((s, e) => | ||
{ | ||
this.SuspendLayout(); | ||
this.BeginInvoke(() => | ||
{ | ||
if (WindowState == FormWindowState.Minimized && ShowInTaskbar) | ||
{ | ||
ShowInTaskbar = false; | ||
notifyIcon1.ShowBalloonTip(10_000, "FileSyncAppWin", "I am here", ToolTipIcon.Info); | ||
notifyIcon1.Visible = true; | ||
} | ||
}); | ||
this.ResumeLayout(); | ||
}); | ||
notifyIcon1.Click += (s, e) => | ||
{ | ||
this.BeginInvoke(() => { WindowState = FormWindowState.Normal; ShowInTaskbar = true; }); | ||
}; | ||
notifyIcon1.BalloonTipClicked += (s, e) => { this.BeginInvoke(() => { WindowState = FormWindowState.Normal; ShowInTaskbar = true; }); }; | ||
//notifyIcon1.BalloonTipShown += (s, e) => { ShowInTaskbar = false; }; | ||
|
||
//this.WindowState = FormWindowState.Minimized; | ||
} | ||
|
||
|
||
|
||
|
||
private void NewLogOutput(string e) | ||
{ | ||
|
||
this.BeginInvoke(() => { textBox1.Text = string.Join(Environment.NewLine, (new string[] { $"{DateTime.Now.ToString("HH:mm:ss.fff")} {e}" }).Concat(textBox1.Text.Split(Environment.NewLine).Take(1000))); }); | ||
|
||
} | ||
} | ||
} |
Oops, something went wrong.