Thorsten Sommer
0587af18f2
- Added import algorithm - Added FromJsonX() methods to data models - Added possibility to work with temp. database file - Added export processor to handle export process & triggers - Added something changed event e.g. as export trigger - Added possibility to import a JSON export - Updated Git icon
29 lines
1004 B
C#
29 lines
1004 B
C#
using Processor;
|
|
|
|
namespace UI_WinForms.Components;
|
|
|
|
public partial class Main : UserControl
|
|
{
|
|
public Main()
|
|
{
|
|
this.InitializeComponent();
|
|
Program.RestartMainApp = false;
|
|
|
|
// Register the something changed event to trigger the export:
|
|
AppEvents.WhenSomethingChanged += async (_, _) => await ExportProcessor.TriggerExport();
|
|
}
|
|
|
|
private void tabControl_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
if (this.settings.NeedRestart())
|
|
{
|
|
var result = MessageBox.Show("You need to restart the app for the changes to take effect. Do you want to restart?", "Restart required", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
|
|
if(result == DialogResult.Yes)
|
|
{
|
|
Program.RestartMainApp = true;
|
|
AppEvents.ResetAllSubscriptions();
|
|
this.ParentForm!.Close();
|
|
}
|
|
}
|
|
}
|
|
} |