refactor Form1. too much in 1 file
This commit is contained in:
parent
55285427f1
commit
0e46cdb514
17 changed files with 850 additions and 668 deletions
37
Source/LibationWinForms/Form1.ScanNotification.cs
Normal file
37
Source/LibationWinForms/Form1.ScanNotification.cs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
using ApplicationServices;
|
||||
|
||||
namespace LibationWinForms
|
||||
{
|
||||
// This is for the Scanning notificationin the upper right. This shown for manual scanning and auto-scan
|
||||
public partial class Form1
|
||||
{
|
||||
private void Configure_ScanNotification()
|
||||
{
|
||||
LibraryCommands.ScanBegin += LibraryCommands_ScanBegin;
|
||||
LibraryCommands.ScanEnd += LibraryCommands_ScanEnd;
|
||||
}
|
||||
|
||||
private void LibraryCommands_ScanBegin(object sender, int accountsLength)
|
||||
{
|
||||
scanLibraryToolStripMenuItem.Enabled = false;
|
||||
scanLibraryOfAllAccountsToolStripMenuItem.Enabled = false;
|
||||
scanLibraryOfSomeAccountsToolStripMenuItem.Enabled = false;
|
||||
|
||||
this.scanningToolStripMenuItem.Visible = true;
|
||||
this.scanningToolStripMenuItem.Text
|
||||
= (accountsLength == 1)
|
||||
? "Scanning..."
|
||||
: $"Scanning {accountsLength} accounts...";
|
||||
}
|
||||
|
||||
private void LibraryCommands_ScanEnd(object sender, EventArgs e)
|
||||
{
|
||||
scanLibraryToolStripMenuItem.Enabled = true;
|
||||
scanLibraryOfAllAccountsToolStripMenuItem.Enabled = true;
|
||||
scanLibraryOfSomeAccountsToolStripMenuItem.Enabled = true;
|
||||
|
||||
this.scanningToolStripMenuItem.Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue