Einheitliche Benennung

This commit is contained in:
rene
2022-09-14 17:24:17 +02:00
parent faff3b1116
commit eeb6132aee
33 changed files with 317 additions and 271 deletions

View File

@@ -96,15 +96,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="Core\ObservableObject.cs" />
<Compile Include="Core\RelayCommand.cs" />
<Compile Include="MVVM\ViewModels\LoginViewModel.cs" />
<Compile Include="MVVM\ViewModels\MainViewModel.cs" />
<Compile Include="MVVM\ViewModels\ViewModelBase.cs" />
<Compile Include="MVVM\View\LoginView.xaml.cs">
<DependentUpon>LoginView.xaml</DependentUpon>
</Compile>
<Compile Include="Store\NavigationStore.cs" />
<Compile Include="View\Components\ConfirmDemoDialog.xaml.cs">
<DependentUpon>ConfirmDemoDialog.xaml</DependentUpon>
</Compile>
@@ -141,29 +132,30 @@
<Compile Include="Logic\Controller\DownloadController.cs" />
<Compile Include="Logic\Controller\ProcessController.cs" />
<Compile Include="Logic\Controller\ViewController.cs" />
<Compile Include="View\Pages\InfoScreen.xaml.cs">
<DependentUpon>InfoScreen.xaml</DependentUpon>
<Compile Include="View\Frames\FrameBase.cs" />
<Compile Include="View\Frames\InfoFrame.xaml.cs">
<DependentUpon>InfoFrame.xaml</DependentUpon>
</Compile>
<Compile Include="View\Pages\LoadingScreen.xaml.cs">
<DependentUpon>LoadingScreen.xaml</DependentUpon>
<Compile Include="View\Frames\LoadingFrame.xaml.cs">
<DependentUpon>LoadingFrame.xaml</DependentUpon>
</Compile>
<Compile Include="View\Pages\UninstallProgressInfo.cs" />
<Compile Include="View\Pages\UpdateProgressInfo.cs" />
<Compile Include="View\Pages\InstallProgressInfo.cs" />
<Compile Include="View\Pages\GenericProgressInfo.xaml.cs">
<DependentUpon>GenericProgressInfo.xaml</DependentUpon>
<Compile Include="View\Frames\UninstallProgressInfoFrame.cs" />
<Compile Include="View\Frames\UpdateProgressInfoFrame.cs" />
<Compile Include="View\Frames\InstallProgressInfoFrame.cs" />
<Compile Include="View\Frames\GenericProgressFrame.xaml.cs">
<DependentUpon>GenericProgressFrame.xaml</DependentUpon>
</Compile>
<Compile Include="View\Pages\BeWoLoginBorder.xaml.cs">
<DependentUpon>BeWoLoginBorder.xaml</DependentUpon>
<Compile Include="View\FrameView.xaml.cs">
<DependentUpon>FrameView.xaml</DependentUpon>
</Compile>
<Compile Include="View\Pages\InstallInfo.xaml.cs">
<DependentUpon>InstallInfo.xaml</DependentUpon>
<Compile Include="View\Frames\InstallInfoFrame.xaml.cs">
<DependentUpon>InstallInfoFrame.xaml</DependentUpon>
</Compile>
<Compile Include="View\Pages\UpdateInfo.xaml.cs">
<DependentUpon>UpdateInfo.xaml</DependentUpon>
<Compile Include="View\Frames\UpdateInfoFrame.xaml.cs">
<DependentUpon>UpdateInfoFrame.xaml</DependentUpon>
</Compile>
<Compile Include="View\Pages\UninstallInfo.xaml.cs">
<DependentUpon>UninstallInfo.xaml</DependentUpon>
<Compile Include="View\Frames\UninstallInfoFrame.xaml.cs">
<DependentUpon>UninstallInfoFrame.xaml</DependentUpon>
</Compile>
<Compile Include="Logic\Utils\BeWoHelper.cs" />
<Compile Include="Logic\Utils\BeWoLocalConfig.cs" />
@@ -173,13 +165,9 @@
<DependentUpon>PasswortAenderungsView.xaml</DependentUpon>
</Compile>
<Compile Include="Logic\ConnectionProfile.cs" />
<Compile Include="View\WindowImp\PopUpWindow.xaml.cs">
<Compile Include="View\Windows\PopUpWindow.xaml.cs">
<DependentUpon>PopUpWindow.xaml</DependentUpon>
</Compile>
<Page Include="MVVM\View\LoginView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\Components\ConfirmDemoDialog.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -204,7 +192,7 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\Pages\01 LoginPage.xaml">
<Page Include="View\LoginView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
@@ -220,15 +208,15 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\Pages\InfoScreen.xaml">
<Page Include="View\Frames\InfoFrame.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\Pages\GenericProgressInfo.xaml">
<Page Include="View\Frames\GenericProgressFrame.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\Pages\LoadingScreen.xaml">
<Page Include="View\Frames\LoadingFrame.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@@ -236,23 +224,23 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\Pages\BeWoLoginBorder.xaml">
<Page Include="View\FrameView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\Pages\InstallInfo.xaml">
<Page Include="View\Frames\InstallInfoFrame.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\Pages\UpdateInfo.xaml">
<Page Include="View\Frames\UpdateInfoFrame.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\Pages\UninstallInfo.xaml">
<Page Include="View\Frames\UninstallInfoFrame.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\WindowImp\LauncherWindow.xaml">
<Page Include="LauncherWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
@@ -278,8 +266,8 @@
<Compile Include="View\Components\ExceptionMessageBox.xaml.cs">
<DependentUpon>ExceptionMessageBox.xaml</DependentUpon>
</Compile>
<Compile Include="View\Pages\01 LoginPage.xaml.cs">
<DependentUpon>01 LoginPage.xaml</DependentUpon>
<Compile Include="View\LoginView.xaml.cs">
<DependentUpon>LoginView.xaml</DependentUpon>
</Compile>
<Compile Include="View\Components\ProxyLoginView.xaml.cs">
<DependentUpon>ProxyLoginView.xaml</DependentUpon>
@@ -290,11 +278,11 @@
<Compile Include="View\Components\WaitLayer2.xaml.cs">
<DependentUpon>WaitLayer2.xaml</DependentUpon>
</Compile>
<Compile Include="View\WindowImp\LauncherWindow.xaml.cs">
<Compile Include="LauncherWindow.xaml.cs">
<DependentUpon>LauncherWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="View\WindowImp\PopUpWindow.xaml">
<Page Include="View\Windows\PopUpWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@@ -318,7 +306,6 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="BeWoLauncher_1_TemporaryKey.pfx" />
<None Include="BeWoLauncher_TemporaryKey.pfx" />
<None Include="LauncherServiceReferences.bat" />
<None Include="Properties\Settings.settings">
@@ -474,10 +461,6 @@
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<Folder Include="Command\" />
<Folder Include="Logic\Interfaces\" />
<Folder Include="MVVM\Model\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -3,18 +3,12 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:BeWoLauncher"
xmlns:viewModel="clr-namespace:BeWoLauncher.MVVM.ViewModels"
xmlns:view="clr-namespace:BeWoLauncher.MVVM.View"
StartupUri="View/WindowImp/LauncherWindow.xaml" Exit="Application_Exit">
Exit="Application_Exit">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Styles/OrangeBlack.xaml" />
</ResourceDictionary.MergedDictionaries>
<DataTemplate DataType="{x:Type viewModel:LoginViewModel}">
<view:LoginView/>
</DataTemplate>
</ResourceDictionary>
</Application.Resources>
</Application>

View File

@@ -2,7 +2,6 @@
using BeWoLauncher.Logic;
using BeWoLauncher.Logic.Controller;
using BeWoLauncher.ServiceProxy;
using BeWoLauncher.Store;
using BeWoLauncher.WindowImp;
using BS.SharedLauncher;
using BS.SharedLauncher.Information;
@@ -34,18 +33,19 @@ namespace BeWoLauncher
/// </summary>
public partial class LauncherApp : Application
{
private readonly NavigationStore _navigationStore;
public static string ShortVersion => "3";
public static string Version => "Version 3.0";
public LauncherApp()
{
_navigationStore = new NavigationStore();
}
protected override void OnStartup(StartupEventArgs e)
{
MainWindow = new LauncherWindow();
MainWindow.Show();
base.OnStartup(e);
ProcessController.CheckForOtherInstance();
@@ -85,22 +85,17 @@ namespace BeWoLauncher
}
public static void ShowError(string message, string ex, bool showDetails)
{
if (ViewController.LauncherWindow is null)
if (ViewController.CurrentWindow is null)
{
MessageBox.Show(ex, message);
}
else
{
ViewController.LauncherWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)(() =>
ViewController.LauncherWindow.ShowControlAsModalPopUp(new ExceptionMessageBox(message, ex, showDetails))));
ViewController.CurrentWindow.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)(() =>
ViewController.CurrentWindow.ShowControlAsModalPopUp(new ExceptionMessageBox(message, ex, showDetails))));
}
}
#endregion
}
}

View File

@@ -1,4 +1,4 @@
<Window x:Class="BeWoLauncher.WindowImp.LauncherWindow"
<Window x:Class="BeWoLauncher.LauncherWindow"
x:ClassModifier="public"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

View File

@@ -17,7 +17,7 @@ using BeWoLauncher.Utils.Download;
using BS.SharedLauncher;
using BS.SharedLauncher.Information;
namespace BeWoLauncher.WindowImp
namespace BeWoLauncher
{
public partial class LauncherWindow : Window
{
@@ -34,7 +34,7 @@ namespace BeWoLauncher.WindowImp
_ModalPopUpControls = new Stack<Control>();
ViewController.LauncherWindow = this;
ViewController.CurrentWindow = this;
ViewController.StartView();

View File

@@ -136,7 +136,7 @@ namespace BeWoLauncher.Logic.Controller
if (data == "GUI geladen")
{
ViewController.LauncherWindow.Dispatcher.BeginInvoke(DispatcherPriority.Render, (Action)(() => ViewController.LauncherWindow.Hide()));
ViewController.CurrentWindow.Dispatcher.BeginInvoke(DispatcherPriority.Render, (Action)(() => ViewController.CurrentWindow.Hide()));
}
}
}

View File

@@ -1,6 +1,7 @@
using BeWoLauncher.Logic.Controller;
using BeWoLauncher.Utils;
using BeWoLauncher.View.Pages;
using BeWoLauncher.View;
using BeWoLauncher.View.Frames;
using BeWoLauncher.WindowImp;
using BS.SharedLauncher.Extensions;
using BS.SharedLauncher.Information;
@@ -19,11 +20,9 @@ namespace BeWoLauncher.Logic.Controller
{
public static class ViewController
{
static bool isBeWoLoginBorderPresent = false;
static BeWoLoginBorder BeWoLoginBorder = null;
static LauncherPageType currentPage;
private static Exception error;
private static UserControl _currentView;
private static FrameBase _currentFrame;
private static Exception error;
public enum LauncherPageType
{
@@ -42,11 +41,39 @@ namespace BeWoLauncher.Logic.Controller
NoPermissionInfo
}
public static LauncherWindow CurrentWindow { get; set; }
public static UserControl CurrentView
{
get => _currentView;
set
{
_currentView = value;
public static LauncherWindow LauncherWindow { get; set; }
Dispatcher.BeginInvoke(DispatcherPriority.Render,
(Action)delegate
{
CurrentWindow.SetMainContent(value);
});
}
}
public static FrameBase CurrentFrame
{
get => _currentFrame; set
{
_currentFrame = value;
public static Dispatcher Dispatcher => LauncherWindow.Dispatcher;
if (CurrentView is FrameView frameview)
Dispatcher.BeginInvoke(DispatcherPriority.Render,
(Action)delegate
{
frameview.SetFrame(value);
});
else
CurrentView = new FrameView(value);
}
}
public static Dispatcher Dispatcher => CurrentWindow.Dispatcher;
public static void StartView()
{
@@ -55,12 +82,12 @@ namespace BeWoLauncher.Logic.Controller
public static void RestartView()
{
ShowPage(LauncherPageType.Login);
LauncherWindow.Show();
LauncherWindow.Activate();
CurrentWindow.Show();
CurrentWindow.Activate();
}
public static void StartWaiting() => LauncherWindow.StartWaiting();
public static void EndWaiting() => LauncherWindow.EndWaiting();
public static void StartWaiting() => CurrentWindow.StartWaiting();
public static void EndWaiting() => CurrentWindow.EndWaiting();
public static bool CheckForPermissions(string path)
{
@@ -119,7 +146,7 @@ namespace BeWoLauncher.Logic.Controller
var autologin = bool.TryParse(ConfigurationManager.AppSettings.Get("AutoLogin"), out bool c) && c;
if (autologin)
if (sender is LoginPage loginPage)
if (sender is LoginView loginPage)
loginPage.ClickLogin();
}
public static void LoginSuccessful(object sender, EventArgs e)
@@ -144,28 +171,28 @@ namespace BeWoLauncher.Logic.Controller
if (BeWoPaths.ActualPlanerLocation is object && !CheckForPermissions(BeWoPaths.ActualPlanerLocation))
{
ShowPage(LauncherPageType.NoPermissionInfo);
ShowPage(LauncherPageType.NoPermissionInfo);
}
else
{
CheckForNewestVersion();
}
}
private static UserControl GetNewPage(LauncherPageType type)
{
switch (type)
{
case LauncherPageType.Login:
var login = new LoginPage();
var login = new LoginView();
login.Loaded += CheckForAutoLogin;
login.LoginSuccessful += LoginSuccessful;
return login;
case LauncherPageType.InstallInfo:
var install = new InstallInfo();
var install = new InstallInfoFrame();
install.Accept += (s, e) =>
{
@@ -182,10 +209,10 @@ namespace BeWoLauncher.Logic.Controller
};
install.Abort += (s, e) => { ShowPage(LauncherPageType.Login); };
return GetControlInBorder(install);
return GetControlInFrameView(install);
case LauncherPageType.InstallProgress:
var installprogress = new InstallProgressInfo();
var installprogress = new InstallProgressInfoFrame();
installprogress.InstallSuccessful += (s, e) =>
{
@@ -193,77 +220,77 @@ namespace BeWoLauncher.Logic.Controller
ProcessController.StartPlanerProcess();
};
return GetControlInBorder(installprogress);
return GetControlInFrameView(installprogress);
case LauncherPageType.InstallFailed:
var installError = new InfoScreen();
var installError = new InfoFrame();
installError.Title = "Installation fehlgeschlagen!";
installError.Text = error.ToString();
installError.Button1Click += (s, e) => { ShowPage(LauncherPageType.Login); };
return GetControlInBorder(installError);
return GetControlInFrameView(installError);
case LauncherPageType.UpdateInfo:
var update = new UpdateInfo();
var update = new UpdateInfoFrame();
update.Accept += (s, e) => { ShowPage(LauncherPageType.UpdateProgress); };
update.Abort += (s, e) => { ShowPage(LauncherPageType.Login); };
return GetControlInBorder(update);
return GetControlInFrameView(update);
case LauncherPageType.UpdateProgress:
var updateProgress = new UpdateProgressInfo();
var updateProgress = new UpdateProgressInfoFrame();
updateProgress.UpdateSuccessful += (s, e) => { ShowPage(LauncherPageType.LoadingScreen); };
return GetControlInBorder(updateProgress);
return GetControlInFrameView(updateProgress);
case LauncherPageType.UpdateFailed:
var updateError = new InfoScreen();
var updateError = new InfoFrame();
updateError.Title = "Update fehlgeschlagen!";
updateError.Text = error.ToString();
updateError.Button1Click += (s, e) => { ShowPage(LauncherPageType.Login); };
return GetControlInBorder(updateError);
return GetControlInFrameView(updateError);
case LauncherPageType.UninstallInfo:
var uninstall = new UninstallInfo();
var uninstall = new UninstallInfoFrame();
uninstall.Accept += (s, e) => { ShowPage(LauncherPageType.UpdateProgress); };
uninstall.Abort += (s, e) => { ShowPage(LauncherPageType.Login); };
return GetControlInBorder(uninstall);
return GetControlInFrameView(uninstall);
case LauncherPageType.UninstallProgress:
var uninstallProgress = new UninstallProgressInfo();
var uninstallProgress = new UninstallProgressInfoFrame();
uninstallProgress.UninstallSuccessful += (s, e) => { ShowPage(LauncherPageType.UninstallSuccessful); };
return GetControlInBorder(uninstallProgress);
return GetControlInFrameView(uninstallProgress);
case LauncherPageType.UninstallFailed:
var uninstallFailed = new InfoScreen();
var uninstallFailed = new InfoFrame();
uninstallFailed.Title = "Deinstallation fehlgeschlagen!";
uninstallFailed.Text = error.ToString();
uninstallFailed.Button1Click += (s, e) => { ShowPage(LauncherPageType.Login); };
return GetControlInBorder(uninstallFailed);
return GetControlInFrameView(uninstallFailed);
case LauncherPageType.UninstallSuccessful:
var uninstallSuccessful = new InfoScreen();
var uninstallSuccessful = new InfoFrame();
uninstallSuccessful.Title = "Deinstallation erfolgreich!";
uninstallSuccessful.Text = "Kehre zum Login zurück...";
@@ -272,7 +299,7 @@ namespace BeWoLauncher.Logic.Controller
uninstallSuccessful.Button1Click += (s, e) => { ShowPage(LauncherPageType.Login); };
return GetControlInBorder(uninstallSuccessful);
return GetControlInFrameView(uninstallSuccessful);
case LauncherPageType.LoadingScreen:
@@ -283,76 +310,52 @@ namespace BeWoLauncher.Logic.Controller
Task.Run(() => ProcessController.StartPlanerProcess());
};
return GetControlInBorder(loading);
return GetControlInFrameView(loading);
case LauncherPageType.NoPermissionInfo:
var noper = new InfoScreen();
var noper = new InfoFrame();
noper.Title = "Keine Rechte auf Speicherort!";
noper.Text = "Es liegt eine neue Version. Sie besitzen aber nicht die benötigten Rechte, um diese anzuwenden. Bitte wenden Sie sich an Ihren System-Administrator!";
noper.Button1Click += (s, e) => { ShowPage(LauncherPageType.Login); };
return GetControlInBorder(noper);
return GetControlInFrameView(noper);
}
throw new NotImplementedException();
}
private static UserControl GetControlInBorder(UserControl uc)
private static UserControl GetControlInFrameView(UserControl uc)
{
if (isBeWoLoginBorderPresent)
if (CurrentView is FrameView)
return uc;
BeWoLoginBorder = new BeWoLoginBorder();
isBeWoLoginBorderPresent = true;
var frame = uc as FrameBase;
BeWoLoginBorder.contentGrid.Children.Clear();
BeWoLoginBorder.contentGrid.Children.Add(uc);
if (frame is null)
{
throw new NotImplementedException("uc ist kein Frame");
}
return BeWoLoginBorder;
var view = new FrameView();
view.SetFrame(frame);
return view;
}
private static void ShowPage(LauncherPageType type)
{
bool before = isBeWoLoginBorderPresent;
var page = GetNewPage(type);
if (type == LauncherPageType.Login)
{
isBeWoLoginBorderPresent = false;
BeWoLoginBorder = null;
Dispatcher.BeginInvoke(DispatcherPriority.Render,
(Action)delegate
{
LauncherWindow.SetMainContent(page);
});
CurrentView = page;
}
else
else if(page is FrameBase frame)
{
// Neu Laden
if (!before)
{
Dispatcher.BeginInvoke(DispatcherPriority.Render,
(Action)delegate
{
LauncherWindow.SetMainContent(page);
});
}
// Bereits geladen
else
{
Dispatcher.BeginInvoke(DispatcherPriority.Render,
(Action)delegate
{
BeWoLoginBorder.contentGrid.Children.Clear();
BeWoLoginBorder.contentGrid.Children.Add(page);
});
}
CurrentFrame = frame;
}
currentPage = type;
}
}
}

View File

@@ -149,7 +149,12 @@ namespace BeWoLauncher.Utils.Download
Thread.Sleep(500);
FileController.RemoveFiles(BeWoPaths.ActualPlanerLocation);
var t = new PlanerPackageInfoDC()
{
Files = new List<PlanerFileInfoDC>()
};
FileController.RemoveUnsuedFiles(t, BeWoPaths.ActualPlanerLocation, apply);
}
}
}

View File

@@ -42,9 +42,9 @@ namespace BeWoLauncher.Components
private void Button_Click(object sender, RoutedEventArgs e)
{
if(ViewController.LauncherWindow != null)
if(ViewController.CurrentWindow != null)
{
ViewController.LauncherWindow.CloseCurrentPopUp();
ViewController.CurrentWindow.CloseCurrentPopUp();
}
}
}

View File

@@ -1,4 +1,4 @@
<UserControl x:Class="BeWoLauncher.View.Pages.BeWoLoginBorder"
<UserControl x:Class="BeWoLauncher.View.FrameView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -38,11 +38,11 @@
<Image Grid.Row="0" Grid.ColumnSpan="4" HorizontalAlignment="Left" VerticalAlignment="Top" Source="pack://application:,,,/View/Icons/bewoplaner_logo_big.png" Height="45" Margin="7,7,0,0"/>
<Label VerticalAlignment="Top" HorizontalAlignment="Right" Content="Version x.x.x" Foreground="#FF818181" Margin="5,7,3,0" Grid.Row="0" Grid.ColumnSpan="4"
Grid.Column="0" FontSize="10" x:Name="lblVersion" />
<Button Grid.Row="7" Grid.Column="2" Click="Button_Click" Visibility="Hidden">Debug</Button>
<Grid x:Name="contentGrid" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="4" Margin="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Button Grid.Row="7" Grid.Column="2" Visibility="Hidden">Debug</Button>
<Grid x:Name="contentGrid" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="4" Margin="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
</Grid>
<TextBlock x:Name="txtCopyright" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="10" Margin="10,5,0,5" Text="Copyright 2017 | beyondSoft GmbH" Foreground="#FF818181"/>

View File

@@ -1,5 +1,6 @@
using BeWoLauncher.Logic;
using BeWoLauncher.Logic.Controller;
using BeWoLauncher.View.Frames;
using BeWoLauncher.WindowImp;
using System;
using System.Collections.Generic;
@@ -17,51 +18,69 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace BeWoLauncher.View.Pages
namespace BeWoLauncher.View
{
/// <summary>
/// Interaktionslogik für BeWoLoginBorder.xaml
/// </summary>
public partial class BeWoLoginBorder : UserControl
public partial class FrameView : UserControl
{
public Action PinEinblenden { get; set; }
public BeWoLoginBorder()
public FrameView()
{
InitializeComponent();
DateTime dt = new DateTime(2017, 1, 1);
if (DateTime.Now > dt)
dt = DateTime.Now;
txtCopyright.Text = String.Format("Copyright {0:yyyy} | beyondSoft GmbH", dt);
lblVersion.Content = LauncherApp.Version;
}
public FrameView(FrameBase frame)
{
SetFrame(frame);
}
private void Hyperlink_OnRequestNavigate(object sender, RequestNavigateEventArgs e)
{
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo((sender as Hyperlink).NavigateUri.ToString()));
}
int i = 0;
private void Button_Click(object sender, RoutedEventArgs e)
public FrameBase GetFrame()
{
switch (i)
{
case 0:
//ViewController.ShowPage(ViewController.LauncherPageType.UpdateInfo1);
break;
case 1:
//ViewController.ShowPage(ViewController.LauncherPageType.UpdateInfo2);
break;
case 2:
//ViewController.ShowPage(ViewController.LauncherPageType.UpdateInfo3);
break;
}
i++;
return contentGrid.Children?[0] as FrameBase;
}
public void SetFrame(FrameBase uc)
{
contentGrid.Children.Add(uc);
}
public void ClearFrame()
{
contentGrid.Children.Clear();
}
// Zum Debuggen
//int i = 0;
//private void Button_Click(object sender, RoutedEventArgs e)
//{
// switch (i)
// {
// case 0:
// //ViewController.ShowPage(ViewController.LauncherPageType.UpdateInfo1);
// break;
// case 1:
// //ViewController.ShowPage(ViewController.LauncherPageType.UpdateInfo2);
// break;
// case 2:
// //ViewController.ShowPage(ViewController.LauncherPageType.UpdateInfo3);
// break;
// }
// i++;
//}
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
namespace BeWoLauncher.View.Frames
{
public class FrameBase : UserControl
{
}
}

View File

@@ -1,4 +1,6 @@
<UserControl x:Class="BeWoLauncher.View.Pages.GenericProgressInfo"
<frames:FrameBase
x:Class="BeWoLauncher.View.Frames.GenericProgressInfo"
xmlns:frames="clr-namespace:BeWoLauncher.View.Frames"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -11,7 +13,10 @@
<Label x:Name="lblMessage" Content="t - bewoplaner wird aktualisiert..." Foreground="#FF000000" FontSize="12" FontWeight="Bold" Margin="0,0,0,0" />
<Label x:Name="lblSubmessage" Content="t - Update wird installiert" Foreground="#FF000000" FontSize="12" />
</StackPanel>
<ProgressBar DockPanel.Dock="Top" x:Name="proBar1" Width="500" Height="20" Minimum="0" Maximum="100" IsIndeterminate="True"/>
<StackPanel DockPanel.Dock="Top" Margin="0,0,0,0" Orientation="Vertical" VerticalAlignment="Center">
<ProgressBar DockPanel.Dock="Top" x:Name="proBar1" Width="500" Height="20" Minimum="0" Maximum="100" IsIndeterminate="True" Margin="5"/>
<ProgressBar DockPanel.Dock="Top" x:Name="proBar2" Width="500" Height="20" Minimum="0" Maximum="100" IsIndeterminate="True"/>
</StackPanel>
</DockPanel>
</Grid>
</UserControl>
</frames:FrameBase>

View File

@@ -29,15 +29,17 @@ using BS.SharedLauncher.Information;
using BS.SharedLauncher.Update;
using Path = System.IO.Path;
namespace BeWoLauncher.View.Pages
namespace BeWoLauncher.View.Frames
{
/// <summary>
/// Interaktionslogik für UpdateView.xaml
/// </summary>
public abstract partial class GenericProgressInfo : UserControl
public abstract partial class GenericProgressInfo : FrameBase
{
public readonly BackgroundWorker Worker = new BackgroundWorker();
private int lastStep = -1;
public GenericProgressInfo()
{
InitializeComponent();
@@ -46,6 +48,9 @@ namespace BeWoLauncher.View.Pages
proBar1.Minimum = 0;
proBar1.Maximum = 100;
proBar2.IsIndeterminate = true;
proBar2.Minimum = 0;
Loaded += (s, e) => Start();
}
@@ -62,11 +67,25 @@ namespace BeWoLauncher.View.Pages
public abstract void Start();
public void BarActivate() => proBar1.IsIndeterminate = false;
public void BarDeactivate() => proBar1.IsIndeterminate = true;
public void BarSetLimit(int max) => proBar1.Maximum = max;
public void BarMakeStep() => proBar1.Value++;
public void BarHide() => proBar1.Visibility = Visibility.Collapsed;
public void BarShow() => proBar1.Visibility = Visibility.Visible;
public void Bar1Activate() => proBar1.IsIndeterminate = false;
public void Bar1Deactivate() => proBar1.IsIndeterminate = true;
public void Bar1SetLimit(int max) => proBar1.Maximum = max;
public void Bar1MakeStep() => proBar1.Value++;
public void Bar1Hide() => proBar1.Visibility = Visibility.Collapsed;
public void Bar1Show() => proBar1.Visibility = Visibility.Visible;
public void Bar2Activate() => proBar2.IsIndeterminate = false;
public void Bar2Deactivate() => proBar2.IsIndeterminate = true;
public void Bar2SetLimit(int max) => proBar2.Maximum = max;
public void Bar2MakeStep(int step)
{
if(step > lastStep)
{
lastStep = step;
proBar2.Value++;
}
}
public void Bar2Hide() => proBar2.Visibility = Visibility.Collapsed;
public void Bar2Show() => proBar2.Visibility = Visibility.Visible;
}
}

View File

@@ -1,9 +1,9 @@
<UserControl x:Class="BeWoLauncher.View.Pages.InfoScreen"
<local:FrameBase x:Class="BeWoLauncher.View.Frames.InfoFrame"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BeWoLauncher.View.Pages"
xmlns:local="clr-namespace:BeWoLauncher.View.Frames"
mc:Ignorable="d"
d:DesignHeight="400" d:DesignWidth="600">
<Grid x:Name="root" >
@@ -17,4 +17,4 @@
</StackPanel>
</DockPanel>
</Grid>
</UserControl>
</local:FrameBase>

View File

@@ -13,16 +13,16 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace BeWoLauncher.View.Pages
namespace BeWoLauncher.View.Frames
{
/// <summary>
/// Interaktionslogik für ErrorScreen.xaml
/// </summary>
public partial class InfoScreen : UserControl
public partial class InfoFrame : FrameBase
{
public event EventHandler Button1Click;
public InfoScreen()
public InfoFrame()
{
InitializeComponent();
}

View File

@@ -1,4 +1,6 @@
<UserControl x:Class="BeWoLauncher.View.Pages.InstallInfo"
<local:FrameBase
x:Class="BeWoLauncher.View.Frames.InstallInfoFrame"
xmlns:local="clr-namespace:BeWoLauncher.View.Frames"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -48,4 +50,4 @@
</GroupBox>
</DockPanel>
</Grid>
</UserControl>
</local:FrameBase>

View File

@@ -21,17 +21,17 @@ using System.Windows.Navigation;
using System.Windows.Shapes;
using Path = System.IO.Path;
namespace BeWoLauncher.View.Pages
namespace BeWoLauncher.View.Frames
{
/// <summary>
/// Interaktionslogik für UpdateInfo1.xaml
/// </summary>
public partial class InstallInfo : UserControl
public partial class InstallInfoFrame : FrameBase
{
public event EventHandler Accept;
public event EventHandler Abort;
public InstallInfo()
public InstallInfoFrame()
{
InitializeComponent();

View File

@@ -12,20 +12,20 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace BeWoLauncher.View.Pages
namespace BeWoLauncher.View.Frames
{
public class InstallProgressInfo : GenericProgressInfo
public class InstallProgressInfoFrame : GenericProgressInfo
{
public event EventHandler InstallSuccessful;
public event EventHandler InstallFailed;
public DownloadManager Manager => DownloadController.Manager;
public InstallProgressInfo()
public InstallProgressInfoFrame() : base()
{
BarSetLimit(Manager.ResponseInfo.FileCount);
Bar1SetLimit(Manager.ResponseInfo.FileCount);
BarDeactivate();
Bar1Deactivate();
}
public override void Start()
@@ -78,36 +78,48 @@ namespace BeWoLauncher.View.Pages
private void worker_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
Bar2SetLimit(5);
if (e.ProgressPercentage == 0)
{
Message = "Installation wird vorbereitet...";
SubMessage = "Lade benötigte Pakete herunter...";
Bar2MakeStep(e.ProgressPercentage);
}
else if (e.ProgressPercentage == 1)
{
Message = "Installiere Pakete...";
SubMessage = "";
BarActivate();
Bar1Activate();
Bar2MakeStep(e.ProgressPercentage);
}
else if (e.ProgressPercentage == 2)
{
var args = e.UserState as FileEventArgs;
SubMessage = $"{args.Name} wurde erfolgreich von {args.AbsolutePath} installiert!";
BarMakeStep();
Bar1MakeStep();
Bar2MakeStep(e.ProgressPercentage);
}
else if (e.ProgressPercentage == 3)
{
BarDeactivate();
Bar1Deactivate();
Message = "Alte Dateien werden entfernt.";
SubMessage = "";
Bar2MakeStep(e.ProgressPercentage);
}
else if (e.ProgressPercentage == 4)
{
var args = e.UserState as string;
SubMessage = $"{args} wurde entfernt!";
Bar2MakeStep(e.ProgressPercentage);
}
}
}

View File

@@ -1,9 +1,9 @@
<UserControl x:Class="BeWoLauncher.View.Pages.LoadingScreen"
<local:FrameBase x:Class="BeWoLauncher.View.Frames.LoadingScreen"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BeWoLauncher.View.Pages"
xmlns:local="clr-namespace:BeWoLauncher.View.Frames"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" Loaded="UserControl_Loaded">
<Grid>
@@ -12,4 +12,4 @@
<ProgressBar DockPanel.Dock="Top" Height="30" IsIndeterminate="True" Margin="10" ></ProgressBar>
</DockPanel>
</Grid>
</UserControl>
</local:FrameBase>

View File

@@ -13,12 +13,12 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace BeWoLauncher.View.Pages
namespace BeWoLauncher.View.Frames
{
/// <summary>
/// Interaktionslogik für LoadingScreen.xaml
/// </summary>
public partial class LoadingScreen : UserControl
public partial class LoadingScreen : FrameBase
{
public LoadingScreen()
{

View File

@@ -1,8 +1,9 @@
<UserControl x:Class="BeWoLauncher.View.Pages.UninstallInfo"
<local:FrameBase x:Class="BeWoLauncher.View.Frames.UninstallInfoFrame"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BeWoLauncher.View.Frames"
mc:Ignorable="d"
d:DesignHeight="400" d:DesignWidth="600" >
<Grid>
@@ -16,4 +17,4 @@
</StackPanel>
</DockPanel>
</Grid>
</UserControl>
</local:FrameBase>

View File

@@ -13,17 +13,17 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace BeWoLauncher.View.Pages
namespace BeWoLauncher.View.Frames
{
/// <summary>
/// Interaktionslogik für UpdateInfo3.xaml
/// </summary>
public partial class UninstallInfo : UserControl
public partial class UninstallInfoFrame : FrameBase
{
public event EventHandler Accept;
public event EventHandler Abort;
public UninstallInfo()
public UninstallInfoFrame()
{
InitializeComponent();
}

View File

@@ -1,4 +1,5 @@
using BeWoLauncher.Logic.Controller;
using BS.SharedLauncher.Update;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -7,15 +8,16 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace BeWoLauncher.View.Pages
namespace BeWoLauncher.View.Frames
{
public class UninstallProgressInfo : GenericProgressInfo
public class UninstallProgressInfoFrame : GenericProgressInfo
{
public event EventHandler UninstallSuccessful;
public UninstallProgressInfo()
public UninstallProgressInfoFrame()
{
BarDeactivate();
Bar1Deactivate();
Bar2Hide();
}
public override void Start()
@@ -32,7 +34,7 @@ namespace BeWoLauncher.View.Pages
void worker_DoWork(object sender, DoWorkEventArgs e)
{
BackgroundWorker worker = sender as BackgroundWorker;
DownloadController.Manager.StartUninstall(worker.ReportProgress);
}
@@ -50,28 +52,9 @@ namespace BeWoLauncher.View.Pages
private void worker_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
if (e.ProgressPercentage == 0)
if (e.ProgressPercentage == 3)
{
Message = "Installation wird vorbereitet...";
SubMessage = "Lade benötigte Pakete herunter...";
}
else if (e.ProgressPercentage == 1)
{
Message = "Installiere Pakete...";
SubMessage = "";
BarActivate();
}
else if (e.ProgressPercentage == 2)
{
var args = e.UserState as FileEventArgs;
SubMessage = $"{args.Name} wurde erfolgreich von {args.AbsolutePath} installiert!";
BarMakeStep();
}
else if (e.ProgressPercentage == 3)
{
BarDeactivate();
Bar1Deactivate();
Message = "Alte Dateien werden entfernt.";
SubMessage = "";

View File

@@ -1,4 +1,6 @@
<UserControl x:Class="BeWoLauncher.View.Pages.UpdateInfo"
<frames:FrameBase
x:Class="BeWoLauncher.View.Frames.UpdateInfoFrame"
xmlns:frames="clr-namespace:BeWoLauncher.View.Frames"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -40,4 +42,4 @@
</StackPanel>
</DockPanel>
</Grid>
</UserControl>
</frames:FrameBase>

View File

@@ -17,17 +17,17 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace BeWoLauncher.View.Pages
namespace BeWoLauncher.View.Frames
{
/// <summary>
/// Interaktionslogik für UpdateInfo2.xaml
/// </summary>
public partial class UpdateInfo : UserControl
public partial class UpdateInfoFrame : FrameBase
{
public event EventHandler Accept;
public event EventHandler Abort;
public UpdateInfo()
public UpdateInfoFrame()
{
InitializeComponent();

View File

@@ -12,19 +12,19 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace BeWoLauncher.View.Pages
namespace BeWoLauncher.View.Frames
{
public class UpdateProgressInfo : GenericProgressInfo
public class UpdateProgressInfoFrame : GenericProgressInfo
{
public event EventHandler UpdateSuccessful;
public DownloadManager Manager => DownloadController.Manager;
public UpdateProgressInfo()
public UpdateProgressInfoFrame()
{
BarSetLimit(Manager.ResponseInfo.FileCount);
Bar1SetLimit(Manager.ResponseInfo.FileCount);
BarDeactivate();
Bar1Deactivate();
}
public override void Start()
@@ -77,36 +77,46 @@ namespace BeWoLauncher.View.Pages
private void worker_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
Bar2SetLimit(5);
if (e.ProgressPercentage == 0)
{
Message = "Update wird vorbereitet...";
SubMessage = "Lade benötigte Pakete herunter...";
Bar2MakeStep(e.ProgressPercentage);
}
else if (e.ProgressPercentage == 1)
{
Message = "Aktualisiere Pakete...";
SubMessage = "";
BarActivate();
Bar1Activate();
Bar2MakeStep(e.ProgressPercentage);
}
else if (e.ProgressPercentage == 2)
{
var args = e.UserState as FileEventArgs;
SubMessage = $"{args.Name} wurde erfolgreich von {args.AbsolutePath} installiert!";
BarMakeStep();
Bar1MakeStep();
Bar2MakeStep(e.ProgressPercentage);
}
else if (e.ProgressPercentage == 3)
{
BarDeactivate();
Bar2Deactivate();
Message = "Alte Dateien werden entfernt.";
SubMessage = "";
Bar2MakeStep(e.ProgressPercentage);
}
else if (e.ProgressPercentage == 4)
{
var args = e.UserState as string;
SubMessage = $"{args} wurde entfernt!";
Bar2MakeStep(e.ProgressPercentage);
}
}
}

View File

@@ -1,4 +1,4 @@
<UserControl x:Class="BeWoLauncher.View.Pages.LoginPage"
<UserControl x:Class="BeWoLauncher.View.LoginView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

View File

@@ -34,12 +34,12 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Threading;
namespace BeWoLauncher.View.Pages
namespace BeWoLauncher.View
{
/// <summary>
/// Interaktionslogik für LoginView.xaml
/// </summary>
public partial class LoginPage : UserControl, INotifyPropertyChanged
public partial class LoginView : UserControl, INotifyPropertyChanged
{
public event EventHandler LoginSuccessful;
public event PropertyChangedEventHandler PropertyChanged;
@@ -66,7 +66,7 @@ namespace BeWoLauncher.View.Pages
private string GETSTATUSMESSAGE_URL = "https://support.bewoplaner.de/api/getstate.php?k={0}&t=1&v={1}";
private string GETNETMESSAGE_URL = "https://support.bewoplaner.de/api/getxmlstate.php?k={0}&t=1";
public LoginPage()
public LoginView()
{
InitializeComponent();
@@ -195,7 +195,7 @@ namespace BeWoLauncher.View.Pages
}
private void PasswordBox_Password_OnGotFocus(object sender, RoutedEventArgs e)
{
PasswordBox_Password.SelectAll();
PasswordBox_Password.SelectAll();
}
private void button_addProfile_Click(object sender, RoutedEventArgs rea)
{

View File

@@ -66,7 +66,7 @@ namespace BS.SharedLauncher.Logic
public static void RemoveFiles(string folder)
{
folder.ClearFolder();
}
public static List<string> GetValidDZipPaths(string path)