66 lines
1.7 KiB
C#
66 lines
1.7 KiB
C#
using BeWoLauncher.Components;
|
|
using BeWoLauncher.Logic.Controller;
|
|
using BeWoLauncher.Logic.Utils;
|
|
using BS.SharedLauncher.Extensions;
|
|
using BS.SharedLauncher.Information;
|
|
using System;
|
|
using System.Threading.Tasks;
|
|
using static BeWoLauncher.Logic.Controller.ViewController;
|
|
|
|
namespace BeWoLauncher.Logic.Behavior
|
|
{
|
|
public class LaunchBehavior
|
|
{
|
|
public bool UninstallMode { get; set; }
|
|
|
|
public LaunchBehavior()
|
|
{
|
|
|
|
}
|
|
|
|
public void LoginSuccessful()
|
|
{
|
|
#region confirm demo
|
|
#if DEBUG
|
|
//if (ConnectionInformation.Tenant == "demo")
|
|
//{
|
|
// var dlg = new ConfirmDemoDialog();
|
|
// dlg.ShowDialog();
|
|
//}
|
|
#else
|
|
if (SessionInformation.Login.Tenant == "demo")
|
|
{
|
|
var dlg = new ConfirmDemoDialog();
|
|
dlg.ShowDialog();
|
|
}
|
|
#endif
|
|
#endregion
|
|
|
|
LauncherPaths.ActualPlanerLocation = LauncherPaths.GetInstallLocationFromSetting();
|
|
|
|
if (!string.IsNullOrWhiteSpace(LauncherPaths.ActualPlanerLocation) && !CheckForPermissions(LauncherPaths.ActualPlanerLocation))
|
|
{
|
|
ViewBehavior.ShowFrame(FrameType.NoPermissionInfo);
|
|
EndWaiting();
|
|
}
|
|
else
|
|
{
|
|
if (UninstallMode)
|
|
{
|
|
ViewBehavior.ShowUninstallInfo();
|
|
EndWaiting();
|
|
}
|
|
else
|
|
{
|
|
Task.Run(() => DownloadController.GetCurrentUpdateplan(EndWaiting));
|
|
}
|
|
}
|
|
}
|
|
|
|
public void LaunchPlaner()
|
|
{
|
|
Task.Run(() => ProcessController.StartPlanerProcess());
|
|
}
|
|
}
|
|
}
|