This commit is contained in:
Meik
2026-03-05 09:56:57 +01:00
parent 838e6b1ee1
commit 4013fa8e32
827 changed files with 743038 additions and 0 deletions

View File

@@ -0,0 +1,633 @@
<Window x:Name="_this"
x:Class="C4IT_CustomerPanel.forms.AuthenticationSettings.AuthenticationSettings"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vc="clr-namespace:C4IT_CustomerPanel.Converter"
xmlns:local="clr-namespace:C4IT_CustomerPanel.forms.AuthenticationSettings"
xmlns:cfgHlp="clr-namespace:C4IT_CustomerPanel.libs"
xmlns:ico="clr-namespace:C4IT.AdaptableIcons;assembly=C4IT-AdaptableIcons"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:usrc="clr-namespace:C4IT_CustomerPanel.UserControls"
mc:Ignorable="d"
Title="AuthenticationSettingsPage"
ShowInTaskbar="False"
Topmost="True"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
ResizeMode="NoResize"
AllowsTransparency="True"
Background="Transparent"
MinHeight="100" MinWidth="600" Closed="_this_Closed"
>
<Window.DataContext>
<local:cAuthenticationSettingsController />
</Window.DataContext>
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="40" />
</WindowChrome.WindowChrome>
<Window.Resources>
<vc:LanguageDefinitionsConverter x:Key="LanguageConverter" />
<vc:BooleanToVisibiliyConverter x:Key="VisibilityConverter" />
<vc:BooleanToBlurEffectConverter x:Key="BlurConverter" />
<vc:EnumerationComparisonConverter x:Key="EnumerationComparisonConverter" />
<cfgHlp:ConfigClass x:Key="ConfigClass" />
<Style x:Key="DefaultText" TargetType="TextBlock">
<Setter Property="FontSize"
Value="14" />
<Setter Property="FontFamily"
Value="Calibri" />
<Setter Property="FontWeight"
Value="Bold" />
<Setter Property="Foreground"
Value="Black" />
<Setter Property="VerticalAlignment"
Value="Center" />
<Setter Property="Margin"
Value="0 0 0 0" />
</Style>
<Style x:Key="FocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2" StrokeDashArray="1 2" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" StrokeThickness="1"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="OptionMarkFocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="14,0,0,0" StrokeDashArray="1 2" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" StrokeThickness="1"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SettingsPage.Close.Icon"
TargetType="ico:AdaptableIcon">
<Setter Property="Cursor"
Value="Hand" />
<Setter Property="PrimaryIconColor"
Value="{DynamicResource Color.Menu.Icon}" />
<Setter Property="WindowChrome.IsHitTestVisibleInChrome"
Value="True" />
<Setter Property="BorderPadding"
Value="10"/>
<Style.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="PrimaryIconColor"
Value="{DynamicResource Color.Menu.Icon.Hover}" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="Menu.MenuBar.PinnedIcon.Base"
TargetType="ico:AdaptableIcon">
<Setter Property="Margin"
Value="5, 0, 5, 0" />
<Setter Property="IconBackgroundColor"
Value="Transparent" />
<Setter Property="HorizontalAlignment"
Value="Center" />
<Setter Property="IconHeight"
Value="30" />
<Setter Property="IconWidth"
Value="30" />
<Setter Property="BorderPadding"
Value="5" />
<Setter Property="PrimaryIconColor"
Value="{DynamicResource Color.Menu.Icon}" />
</Style>
<Style x:Key="Menu.MenuBar.PinnedIcon.Pinned"
TargetType="ico:AdaptableIcon"
BasedOn="{StaticResource Menu.MenuBar.PinnedIcon.Base}">
<Setter Property="Cursor"
Value="Hand" />
<Setter Property="HorizontalAlignment"
Value="Center" />
<Setter Property="IconHeight"
Value="36" />
<Setter Property="IconWidth"
Value="36" />
<Setter Property="Margin"
Value="2, -3, 2, -3" />
<Setter Property="BorderPadding"
Value="7.5" />
<Setter Property="PrimaryIconColor"
Value="{DynamicResource Color.Menu.Icon}" />
<Setter Property="IconBackgroundColor"
Value="{DynamicResource Background.Menu.Icon.Hover}" />
<Style.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="PrimaryIconColor"
Value="{DynamicResource Color.Menu.Icon.Hover}" />
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="ico:AdaptableIcon"
BasedOn="{StaticResource Menu.MenuBar.PinnedIcon.Pinned}">
<Setter Property="PrimaryIconColor"
Value="{DynamicResource FontColor.Menu.Categories}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorLevel=1, AncestorType=Border}, Path=IsMouseOver}"
Value="True">
<Setter Property="PrimaryIconColor"
Value="{DynamicResource FontColor.Menu.Categories.Hover}"/>
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="BlurMaskBoarder" TargetType="Border">
<Setter Property="Background" Value="{DynamicResource Color.BlurBorder}"/>
<Setter Property="Opacity" Value="0.4"/>
<Setter Property="CornerRadius" Value="7.5"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="Margin" Value="0 0"/>
<Setter Property="Visibility" Value="{Binding Path=visibilityBlurMask, Converter={StaticResource VisibilityConverter}}"/>
<Setter Property="Grid.RowSpan" Value="999"/>
<Setter Property="Grid.ColumnSpan" Value="999"/>
</Style>
</Window.Resources>
<Border
CornerRadius="10"
Background="#FFEEEEEE"
Padding="10"
>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=M42Settings.SystemTray}"
x:Name="txtHeader"
TextTrimming="CharacterEllipsis"
FontSize="18"
Margin="15,0,0,0"
VerticalAlignment="Center"
FontFamily="Calibri"
FontWeight="Bold"
Grid.Row="0"
Grid.ColumnSpan="3"
Style="{StaticResource DefaultText}"
/>
<ico:AdaptableIcon x:Name="CloseButton"
Grid.Row="0"
HorizontalAlignment="Right"
Style="{DynamicResource SettingsPage.Close.Icon}"
MouseLeftButtonUp="CloseButton_MouseLeftButtonUp"
TouchDown="CloseButton_TouchDown"
SelectedInternIcon="window_close" Grid.Column="2" Margin="335,0,0,0" />
<Grid Grid.Row="1" Effect="{Binding Path=visibilityBlurMask, Converter={StaticResource BlurConverter}}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border Grid.Row="0"
CornerRadius="7.5"
Background="{DynamicResource BackgroundColor.Menu.MainCategory}"
Margin="5,5,5,5"
Padding="10 5"
Grid.ColumnSpan="3"
>
<TextBlock Text="You are not currently logged in to Matrix42 WPM."
x:Name="txtCurrentUser"
Margin="0,0,0,0"
FontStyle="Italic"
FontWeight="Normal"
Grid.Row="0"
Grid.ColumnSpan="3"
Style="{StaticResource DefaultText}"
/>
</Border>
<Border Grid.Row="1" x:Name="borderLogonActive"
CornerRadius="7.5"
Background="{DynamicResource BackgroundColor.Menu.MainCategory}"
Margin="5,5,5,5"
Padding="10 5"
Grid.ColumnSpan="3"
>
<Grid Grid.IsSharedSizeScope="True">
<Grid.RowDefinitions>
<RowDefinition SharedSizeGroup="RowsHeight" />
<RowDefinition SharedSizeGroup="RowsHeight" />
<RowDefinition SharedSizeGroup="RowsHeight" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=M42Settings.LogonActive.Header}"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="2"
Style="{StaticResource DefaultText}"
/>
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=M42Settings.LogonActive.AutoPassthroughOff}"
Grid.Row="1"
Grid.Column="1"
Margin="8 0 0 0"
Style="{StaticResource DefaultText}"
/>
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=M42Settings.LogonActive.LogonDisabled}"
Grid.Row="2"
Grid.Column="1"
Margin="8 0 0 0"
Style="{StaticResource DefaultText}"
/>
<CheckBox x:Name="DisablePassthroughCheckBox"
Style="{DynamicResource ToggleSwitch}"
HorizontalAlignment="Left"
Grid.Row="1"
Grid.Column="0"
Margin="0,6,0,7"
IsChecked="{Binding Path=(local:cAuthenticationSettingsController.noPassthrough)}"
/>
<CheckBox x:Name="DisableLogonCheckBox"
Style="{DynamicResource ToggleSwitch}"
HorizontalAlignment="Left"
Grid.Row="2"
Grid.Column="0"
Margin="0,6,0,7"
IsChecked="{Binding Path=noLogonAtAll}"
/>
</Grid>
</Border>
<Border Grid.Row="2" x:Name="borderLogonMethod"
CornerRadius="7.5"
Background="{DynamicResource BackgroundColor.Menu.MainCategory}"
Margin="5,5,5,5"
Padding="10 5"
Grid.ColumnSpan="3"
Visibility="{Binding Path=visibilityLogonMethod, Converter={StaticResource VisibilityConverter}}"
>
<Grid Grid.IsSharedSizeScope="True">
<Grid.RowDefinitions>
<RowDefinition SharedSizeGroup="RowsHeight" />
<RowDefinition SharedSizeGroup="RowsHeight" />
<RowDefinition SharedSizeGroup="RowsHeight" />
<RowDefinition SharedSizeGroup="RowsHeight" />
<RowDefinition SharedSizeGroup="RowsHeight" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=M42Settings.LogonMethod.AuthenticationMethod}"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="2"
FontWeight="Bold"
Style="{StaticResource DefaultText}"
/>
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=M42Settings.LogonMethod.None}"
Grid.Row="1"
Grid.Column="1"
Margin="8 0 0 0"
Style="{StaticResource DefaultText}"
/>
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=M42Settings.LogonMethod.Basic}"
Grid.Row="2"
Grid.Column="1"
Style="{StaticResource DefaultText}" HorizontalAlignment="Right" Width="519"
/>
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=M42Settings.LogonMethod.Token}"
Grid.Row="3"
Grid.Column="1"
Margin="8 0 0 0"
Style="{StaticResource DefaultText}"
/>
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=M42Settings.LogonMethod.WebForm}"
Grid.Row="4"
Grid.Column="1"
Margin="8 0 0 0"
Style="{StaticResource DefaultText}"
/>
<RadioButton x:Name="radioButtonLogonMethodNone"
Style="{DynamicResource RadioButtonStyle}"
HorizontalAlignment="Left"
Grid.Row="1"
Grid.Column="0"
Margin="4 5"
IsChecked="{Binding Path=(local:cAuthenticationSettingsController.additionalMethod), Converter={StaticResource EnumerationComparisonConverter}, ConverterParameter={x:Static cfgHlp:enumAlternateAuthMethods.none}}"
/>
<RadioButton x:Name="radioButtonLogonMethodBasic"
Style="{DynamicResource RadioButtonStyle}"
HorizontalAlignment="Left"
Grid.Row="2"
Grid.Column="0"
Margin="4 5"
IsChecked="{Binding Path=(local:cAuthenticationSettingsController.additionalMethod), Converter={StaticResource EnumerationComparisonConverter}, ConverterParameter={x:Static cfgHlp:enumAlternateAuthMethods.authCredentials}}"
/>
<RadioButton x:Name="radioButtonLogonMethodToken"
Style="{DynamicResource RadioButtonStyle}"
HorizontalAlignment="Left"
Grid.Row="3"
Grid.Column="0"
Margin="4 5"
IsChecked="{Binding Path=(local:cAuthenticationSettingsController.additionalMethod), Converter={StaticResource EnumerationComparisonConverter}, ConverterParameter={x:Static cfgHlp:enumAlternateAuthMethods.authToken}}"
/>
<RadioButton x:Name="radioButtonLogonMethodForms"
Style="{DynamicResource RadioButtonStyle}"
HorizontalAlignment="Left"
Grid.Row="4"
Grid.Column="0"
Margin="4 5"
IsChecked="{Binding Path=(local:cAuthenticationSettingsController.additionalMethod), Converter={StaticResource EnumerationComparisonConverter}, ConverterParameter={x:Static cfgHlp:enumAlternateAuthMethods.authForms}}"
/>
</Grid>
</Border>
<Border Grid.Row="3" x:Name="additionalBlockLogonMethodBasic"
CornerRadius="7.5"
Background="{DynamicResource BackgroundColor.Menu.MainCategory}"
Margin="5,5,5,5"
Padding="10 5" Grid.ColumnSpan="3"
Visibility="{Binding Path=visibilityAdditionalLogonMethodBasic, Converter={StaticResource VisibilityConverter}}"
>
<Grid Grid.IsSharedSizeScope="True">
<Grid.RowDefinitions>
<RowDefinition SharedSizeGroup="RowsHeight" />
<RowDefinition SharedSizeGroup="RowsHeight" />
<RowDefinition SharedSizeGroup="RowsHeight" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=M42Settings.LogonMethod.Basic.Header}"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="2"
FontWeight="Bold"
Style="{StaticResource DefaultText}"
/>
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=M42Settings.LogonMethod.Basic.Username}"
Grid.Row="1"
Grid.Column="0"
Margin="4 0 0 0"
Style="{StaticResource DefaultText}"
/>
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=M42Settings.LogonMethod.Basic.Password}"
Grid.Row="2"
Grid.Column="0"
Margin="4 0 0 0"
Style="{StaticResource DefaultText}"
/>
<Border
Grid.Row="1"
Grid.Column="1"
Margin="8 5"
CornerRadius="2"
BorderThickness="0.5"
BorderBrush="Gray"
VerticalAlignment="Center"
Padding="3 2"
>
<TextBox
BorderThickness="0"
BorderBrush="Transparent"
VerticalAlignment="Center"
Text="{Binding Path=txtBasicUser}"
/>
</Border>
<usrc:PasswordInputBox
Grid.Row="2"
Grid.Column="1"
Password="{Binding Path=txtBasicPassword, Mode=TwoWay}"
/>
</Grid>
</Border>
<Border Grid.Row="4" x:Name="additionalBlockLogonMethodToken"
CornerRadius="7.5"
Background="{DynamicResource BackgroundColor.Menu.MainCategory}"
Margin="5,5,5,5"
Padding="10 5" Grid.ColumnSpan="3"
Visibility="{Binding Path=visibilityAdditionalLogonMethodToken, Converter={StaticResource VisibilityConverter}, FallbackValue='true'}"
>
<Grid Grid.IsSharedSizeScope="True">
<Grid.RowDefinitions>
<RowDefinition SharedSizeGroup="RowsHeight" />
<RowDefinition SharedSizeGroup="RowsHeight" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=M42Settings.LogonMethod.Token.Header}"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="2"
Style="{StaticResource DefaultText}"
/>
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=M42Settings.LogonMethod.Token.Token}"
Grid.Row="1"
Grid.Column="0"
Margin="4 0 0 0"
Style="{StaticResource DefaultText}"
/>
<usrc:PasswordInputBox
Grid.Row="1"
Grid.Column="1"
Password="{Binding Path=txtTokenSecret}"
/>
</Grid>
</Border>
<Border Grid.Row="5" x:Name="additionalBlockLogonMethodForms"
CornerRadius="7.5"
Background="{DynamicResource BackgroundColor.Menu.MainCategory}"
Margin="5,5,5,5"
Padding="10 5" Grid.ColumnSpan="3"
Visibility="{Binding Path=visibilityAdditionalLogonMethodForms, Converter={StaticResource VisibilityConverter}}"
>
<Grid Grid.IsSharedSizeScope="True">
<Grid.RowDefinitions>
<RowDefinition SharedSizeGroup="RowsHeight" />
<RowDefinition SharedSizeGroup="RowsHeight" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=M42Settings.LogonMethod.Forms.Header}"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="2"
Style="{StaticResource DefaultText}"
/>
<Border
Grid.Row="1"
Grid.Column="1"
Margin="8 5"
CornerRadius="2"
BorderThickness="0.5"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Height="21"
Padding="4 2"
MouseLeftButtonDown="DoFormsAuthentication_MouseLeftButtonDown"
KeyUp="DoFormsAuthentication_KeyUp"
TouchUp="DoFormsAuthentication_TouchUp"
>
<Border.Resources>
<Style TargetType="Border">
<Setter Property="Background"
Value="#F2F2F2" />
<Setter Property="BorderBrush"
Value="Gray" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#FFD8E6FF" />
<Setter Property="BorderBrush" Value="#FF5593FF" />
</Trigger>
</Style.Triggers>
</Style>
</Border.Resources>
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=M42Settings.LogonMethod.Forms.Logon}"
Grid.Row="2"
Grid.Column="0"
Margin="8 0 8 0"
IsHitTestVisible="False"
Style="{StaticResource DefaultText}"
/>
</Border>
</Grid>
</Border>
<TextBlock Grid.Row="6" x:Name="txtAuthenticationError"
Grid.ColumnSpan="3"
Text="{Binding Path=txtErrorMessage}"
Grid.Column="0"
Margin="10 3 0 3"
Foreground="Red"
Visibility="{Binding Path=visibilityErrorMessage, Converter={StaticResource VisibilityConverter}}"
/>
<Grid Grid.Row="7" Grid.ColumnSpan="3">
<Grid.Resources>
<Style TargetType="ico:AdaptableIcon">
<Setter Property="Margin"
Value="0 10 0 0" />
<Setter Property="IconWidth"
Value="125" />
<Setter Property="PrimaryIconColor"
Value="{DynamicResource Color.Menu.Icon}" />
<Setter Property="BorderPadding"
Value="2.5" />
<Setter Property="HorizontalAlignment"
Value="Center" />
<Setter Property="Cursor"
Value="Hand" />
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="7*" />
<ColumnDefinition Width="31*"/>
<ColumnDefinition Width="38*" />
</Grid.ColumnDefinitions>
<ico:AdaptableIcon x:Name="ConfirmButton"
Grid.Column="0"
SelectedMaterialIcon="ic_check" Grid.ColumnSpan="2" HorizontalAlignment="Left" Margin="32,10,0,0" MouseDown="ConfirmButton_MouseDown" TouchDown="ConfirmButton_TouchDown">
<ico:AdaptableIcon.Tag>
<sys:Boolean>True</sys:Boolean>
</ico:AdaptableIcon.Tag>
<ico:AdaptableIcon.Resources>
<Style TargetType="ico:AdaptableIcon"
BasedOn="{StaticResource {x:Type ico:AdaptableIcon}}">
<Style.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="PrimaryIconColor"
Value="{DynamicResource Color.Green}" />
<Setter Property="IconBackgroundColor"
Value="{DynamicResource BackgroundColor.Menu.MainCategory}" />
</Trigger>
</Style.Triggers>
</Style>
</ico:AdaptableIcon.Resources>
</ico:AdaptableIcon>
<ico:AdaptableIcon x:Name="CancelButton"
Grid.Column="2"
SelectedMaterialIcon="ic_close" Margin="0,10,0,0" MouseLeftButtonUp="CloseButton_MouseLeftButtonUp" TouchDown="CloseButton_TouchDown">
<ico:AdaptableIcon.Tag>
<sys:Boolean>False</sys:Boolean>
</ico:AdaptableIcon.Tag>
<ico:AdaptableIcon.Resources>
<Style TargetType="ico:AdaptableIcon"
BasedOn="{StaticResource {x:Type ico:AdaptableIcon}}">
<Setter Property="PrimaryIconColor"
Value="{DynamicResource Color.Menu.Icon}" />
<Style.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="PrimaryIconColor"
Value="{DynamicResource Color.Red}" />
<Setter Property="IconBackgroundColor"
Value="{DynamicResource BackgroundColor.Menu.MainCategory}" />
</Trigger>
</Style.Triggers>
</Style>
</ico:AdaptableIcon.Resources>
</ico:AdaptableIcon>
</Grid>
<Border
Style="{StaticResource BlurMaskBoarder}"
Visibility="{Binding Path=visibilityBlurMask, Converter={StaticResource VisibilityConverter}}"
/>
</Grid>
</Grid>
</Border>
</Window>

View File

@@ -0,0 +1,111 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using C4IT.AdaptableIcons;
namespace C4IT_CustomerPanel.forms.AuthenticationSettings;
public partial class AuthenticationSettings : Window
{
private CPM42FormsAuthentication FormsAuthentication;
public AuthenticationSettings()
{
InitializeComponent();
if (this.DataContext is cAuthenticationSettingsController controller)
controller.Init(false);
}
private void CloseButton_TouchDown(object sender, TouchEventArgs e)
{
Close();
}
private void CloseButton_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
Close();
}
private void iconPasswordShow_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
}
private void ConfirmButton_MouseDown(object sender, MouseButtonEventArgs e)
{
ConfirmButton_Click(sender);
}
private void ConfirmButton_TouchDown(object sender, TouchEventArgs e)
{
ConfirmButton_Click(sender);
}
private async void ConfirmButton_Click(object sender)
{
if (this.DataContext is cAuthenticationSettingsController controller)
controller.SaveSettings();
Close();
}
private void DoFormsAuthentication_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
ShowFormBasedAuthentication();
}
private void DoFormsAuthentication_KeyUp(object sender, KeyEventArgs e)
{
ShowFormBasedAuthentication();
}
private void DoFormsAuthentication_TouchUp(object sender, TouchEventArgs e)
{
ShowFormBasedAuthentication();
}
private void ShowFormBasedAuthentication()
{
Cursor = Cursors.Wait;
if (this.DataContext is cAuthenticationSettingsController controller)
controller.FormsAuthenticationStart();
FormsAuthentication = new CPM42FormsAuthentication();
FormsAuthentication.AuthenticationCompleted += FormsAuthenticationFinished;
FormsAuthentication.Show();
}
public async void FormsAuthenticationFinished(object sender, EventArgs e)
{
string _token = null;
if (sender is CPM42FormsAuthentication _formsAuth)
_token = _formsAuth.AccessToken;
if (this.DataContext is cAuthenticationSettingsController controller)
await controller.FormsAuthenticationFinished(_token);
FormsAuthentication = null;
Cursor = null;
}
private void _this_Closed(object sender, EventArgs e)
{
if (FormsAuthentication != null)
FormsAuthentication.Close();
}
}

View File

@@ -0,0 +1,332 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using C4IT.API;
using C4IT.Matrix42.WebClient;
using C4IT_CustomerPanel.libs;
using static C4IT_CustomerPanel.libs.ConfigClass;
namespace C4IT_CustomerPanel.forms.AuthenticationSettings
{
internal class cAuthenticationSettingsController : INotifyPropertyChanged
{
#region dependency properties
#region noPassthrough property
private bool _noPassthrough = default;
public bool noPassthrough
{
get { return _noPassthrough; }
set
{
if (value != _noPassthrough)
{
_noPassthrough = value;
OnPropertyChanged(nameof(noPassthrough));
CheckLogonSettings();
}
}
}
#endregion noPassthrough property
#region noLogonAtAll property
private bool _noLogonAtAll = default;
public bool noLogonAtAll
{
get { return _noLogonAtAll; }
set
{
if (value != _noLogonAtAll)
{
_noLogonAtAll = value;
OnPropertyChanged(nameof(noLogonAtAll));
CheckLogonSettings();
}
}
}
#endregion noLogonAtAll property
#region additionalMethod property
private enumAlternateAuthMethods _additionalMethod = default;
public enumAlternateAuthMethods additionalMethod
{
get { return _additionalMethod; }
set
{
if (value != _additionalMethod)
{
_additionalMethod = value;
OnPropertyChanged(nameof(additionalMethod));
CheckAdditionalMethodsSelection();
}
}
}
#endregion additionalMethod property
#region visibilityLogonMethod property
private bool _visibilityLogonMethod = default;
public bool visibilityLogonMethod
{
get { return _visibilityLogonMethod; }
set
{
if (value != _visibilityLogonMethod)
{
_visibilityLogonMethod = value;
OnPropertyChanged(nameof(visibilityLogonMethod));
CheckLogonSettings();
}
}
}
#endregion visibilityLogonMethod property
#region visibilityAdditionalLogonMethodBasic property
private bool _visibilityAdditionalLogonMethodBasic = default;
public bool visibilityAdditionalLogonMethodBasic
{
get { return _visibilityAdditionalLogonMethodBasic; }
set
{
if (value != _visibilityAdditionalLogonMethodBasic)
{
_visibilityAdditionalLogonMethodBasic = value;
OnPropertyChanged(nameof(visibilityAdditionalLogonMethodBasic));
}
}
}
#endregion visibilityAdditionalLogonMethodBasic property
#region visibilityAdditionalLogonMethodToken property
private bool _visibilityAdditionalLogonMethodToken = default;
public bool visibilityAdditionalLogonMethodToken
{
get { return _visibilityAdditionalLogonMethodToken; }
set
{
if (value != _visibilityAdditionalLogonMethodToken)
{
_visibilityAdditionalLogonMethodToken = value;
OnPropertyChanged(nameof(visibilityAdditionalLogonMethodToken));
}
}
}
#endregion visibilityAdditionalLogonMethodToken property
#region visibilityAdditionalLogonMethodForms property
private bool _visibilityAdditionalLogonMethodForms = default;
public bool visibilityAdditionalLogonMethodForms
{
get { return _visibilityAdditionalLogonMethodForms; }
set
{
if (value != _visibilityAdditionalLogonMethodForms)
{
_visibilityAdditionalLogonMethodForms = value;
OnPropertyChanged(nameof(visibilityAdditionalLogonMethodForms));
}
}
}
#endregion visibilityAdditionalLogonMethodForms property
#region visibilityErrorMessage property
private bool _visibilityErrorMessage = true;
public bool visibilityErrorMessage
{
get { return _visibilityErrorMessage; }
set
{
if (value != _visibilityErrorMessage)
{
_visibilityErrorMessage = value;
OnPropertyChanged(nameof(visibilityBlurMask));
}
}
}
#endregion visibilityErrorMessage property
#region visibilityBlurMask property
private bool _visibilityBlurMask = false;
public bool visibilityBlurMask
{
get { return _visibilityBlurMask; }
set
{
if (value != _visibilityBlurMask)
{
_visibilityBlurMask = value;
OnPropertyChanged(nameof(visibilityBlurMask));
}
}
}
#endregion visibilityBlurMask property
#region txtBasicUser property
private String _txtBasicUser = "imagoverum\\vvogel";
public String txtBasicUser
{
get { return _txtBasicUser; }
set
{
if (value != _txtBasicUser)
{
_txtBasicUser = value;
OnPropertyChanged(nameof(txtBasicUser));
}
}
}
#endregion txtErrorMessage property
#region txtBasicPassword property
private String _txtBasicPassword = "Matrix42";
public String txtBasicPassword
{
get { return _txtBasicPassword; }
set
{
if (value != _txtBasicPassword)
{
_txtBasicPassword = value;
OnPropertyChanged(nameof(txtBasicPassword));
}
}
}
#endregion txtBasicPassword property
#region txtTokenSecret property
private String _txtTokenSecret = "876543210987";
public String txtTokenSecret
{
get { return _txtTokenSecret; }
set
{
if (value != _txtTokenSecret)
{
_txtTokenSecret = value;
OnPropertyChanged(nameof(txtTokenSecret));
}
}
}
#endregion txtTokenSecret property
#region txtErrorMessage property
private String _txtErrorMessage = "You could not be authenticated. Please change your specification to ensure valid authentication.";
public String txtErrorMessage
{
get { return _txtErrorMessage; }
set
{
if (value != _txtErrorMessage)
{
_txtErrorMessage = value;
OnPropertyChanged(nameof(txtErrorMessage));
}
}
}
#endregion txtErrorMessage property
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string name = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
#endregion dependency properties
private bool isDesignMode = true;
public cAuthenticationSettingsController()
{
Init();
}
public void Init(bool isDesignMode = true)
{
this.isDesignMode = isDesignMode;
visibilityErrorMessage = isDesignMode;
if (!isDesignMode)
{
var authConfig = ConfigClassV2.Instance.Authentication;
noPassthrough = authConfig.noPassthrough;
noLogonAtAll = authConfig.noLogonAtAll;
additionalMethod = authConfig.additionalMethod;
txtBasicUser = authConfig.BasicUsername;
var strDecodedBasicPassword = PrivateCustomerPanelSecurePassword.Instance.Decode(authConfig.BasicPassword);
txtBasicPassword = strDecodedBasicPassword;
txtTokenSecret = PrivateCustomerPanelSecurePassword.Instance.Decode(authConfig.M42AccessToken);
}
CheckLogonSettings();
CheckAdditionalMethodsSelection();
}
private void CheckLogonSettings()
{
visibilityLogonMethod = !noLogonAtAll || isDesignMode;
CheckAdditionalMethodsSelection();
}
private void CheckAdditionalMethodsSelection()
{
visibilityAdditionalLogonMethodBasic = visibilityLogonMethod && (additionalMethod == enumAlternateAuthMethods.authCredentials) || isDesignMode;
visibilityAdditionalLogonMethodToken = visibilityLogonMethod && (additionalMethod == enumAlternateAuthMethods.authToken) || isDesignMode;
visibilityAdditionalLogonMethodForms = visibilityLogonMethod && (additionalMethod == enumAlternateAuthMethods.authForms) || isDesignMode;
}
public void FormsAuthenticationStart()
{
visibilityBlurMask = true;
}
public async Task FormsAuthenticationFinished(string AccessToken)
{
if (!string.IsNullOrEmpty(AccessToken))
{
var m42WebClient = new cM42WebClientV2(MainWindow.MainInstance.ConfigSettings.GetMatrixServer(false), MainWindow.MainInstance.ConfigSettings.GetCultureName(), DisableDNSCache: true);
m42WebClient.RegisterBearerTokenAuthentication(AccessToken);
var _res = await m42WebClient.LogonAsync();
}
visibilityBlurMask = false;
}
public void SaveSettings()
{
var authConfig = ConfigClassV2.Instance.Authentication;
authConfig.noPassthrough = noPassthrough;
authConfig.noLogonAtAll = noLogonAtAll;
authConfig.additionalMethod = additionalMethod;
authConfig.BasicUsername = txtBasicUser;
var strEncodedBasicPassword = PrivateCustomerPanelSecurePassword.Instance.Encode(txtBasicPassword);
authConfig.BasicPassword = strEncodedBasicPassword;
authConfig.M42AccessToken = PrivateCustomerPanelSecurePassword.Instance.Encode(txtTokenSecret);
ConfigClassV2.Instance.Save(@"Authentication\*");
}
}
}

View File

@@ -0,0 +1,83 @@
<Window x:Class="C4IT_CustomerPanel.forms.CPM42FormsAuthentication"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:resx="clr-namespace:C4IT_CustomerPanel.Properties"
xmlns:WebView="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
xmlns:local="clr-namespace:C4IT_CustomerPanel.forms"
mc:Ignorable="d"
ResizeMode="CanResize"
WindowStyle="None"
AllowsTransparency="True"
Background="Transparent"
MinHeight="735"
MinWidth="400"
ShowInTaskbar="False"
Topmost="True"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterScreen"
x:Name="CPM42FormsAuth">
<Border
CornerRadius="0"
Background="{DynamicResource headerColor}"
Padding="10">
<Grid MouseLeftButtonDown="Grid_MouseLeftButtonDown" >
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="TxtHeader" Text="{x:Static resx:Resources.Matrix42_Login}" FontSize="18" Foreground="White" VerticalAlignment="Center" Margin="-5 -15 0 0" FontWeight="Bold"/>
<TextBlock x:Name="Close_Text" Text="X" Foreground="White" MouseLeftButtonDown="Close_Text_MouseLeftButtonDown" HorizontalAlignment="Right" FontSize="20" FontWeight="Bold" Margin="0,-10,0,5" Cursor="Hand"/>
</Grid>
<Border Grid.Row="1"
CornerRadius="7.5"
Background="LightGray">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<WebView:WebView2
x:Name="WebLogon" x:FieldModifier="private"
Loaded="WebLogon_Loaded"
NavigationStarting="WebLogon_NavigationStarting"
Margin="10 10 10 10"
Grid.ColumnSpan="2"/>
<Border
x:Name="NoAccessTokenMessage" x:FieldModifier="private"
Margin="50 0 50 0"
HorizontalAlignment="Left" VerticalAlignment="Center"
Background="LightGray"
CornerRadius="7.5" >
<TextBlock
FontSize="20"
Foreground="Red"
HorizontalAlignment="Center"
VerticalAlignment="Center"
TextWrapping="WrapWithOverflow"
Text="Could not get a valid authorisation token."/>
</Border>
</Grid>
</Border>
</Grid>
</Border>
</Window>

View File

@@ -0,0 +1,208 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Globalization;
using C4IT.Logging;
using static C4IT.Logging.cLogManager;
using Microsoft.Web.WebView2.Core;
using System.Net.Http;
using System.Net.Http.Headers;
using Newtonsoft.Json;
using C4IT.Matrix42.WebClient;
using C4IT_CustomerPanel.libs;
namespace C4IT_CustomerPanel.forms
{
public partial class CPM42FormsAuthentication : Window
{
private Uri _logonUrl = null;
private string _M42Server;
public string AccessToken { get; private set; }
public event EventHandler AuthenticationCompleted;
public CPM42FormsAuthentication()
{
InitializeComponent();
}
private void OnClose(object sender, RoutedEventArgs e)
{
this.Close();
}
private void StartForm()
{
var methodInfo = MethodBase.GetCurrentMethod();
LogMethodBegin(methodInfo);
try
{
LogEntry("Erstelle Uri.", LogLevels.Debug);
_M42Server = MainWindow.MainInstance.ConfigSettings.GetMatrixServer(false);
_logonUrl = new Uri($"https://{_M42Server}/m42Services/api/sts/authorize?client_id=ServiceStore.NewUX&scope=urn:matrix42NewUX&response_type=token&autoLogin=true");
WebLogon.Source = _logonUrl;
}
catch (Exception ex)
{
LogEntry($"Erstellte Uri: {_logonUrl}", LogLevels.Debug);
LogException(ex);
}
finally
{
LogMethodEnd(methodInfo);
}
}
private async void WebLogon_Loaded(object sender, RoutedEventArgs e)
{
var methodInfo = MethodBase.GetCurrentMethod();
LogMethodBegin(methodInfo);
try
{
// set the data path for the WebView2 component
var _webViewConfigPath = cLogManagerFile.GetDefaultPath(false, SubFolder: "WebViewData");
_webViewConfigPath = System.IO.Path.GetDirectoryName(_webViewConfigPath);
CultureInfo culture = new CultureInfo("en-US");
var webEnv = await CoreWebView2Environment.CreateAsync(userDataFolder: _webViewConfigPath, options: new CoreWebView2EnvironmentOptions() { Language = culture.TextInfo.CultureName, AllowSingleSignOnUsingOSPrimaryAccount = true });
var _co = webEnv.CreateCoreWebView2ControllerOptions();
await WebLogon.EnsureCoreWebView2Async(webEnv, _co);
LogEntry($"CreateCoreWebView2ControllerOptions Result: {_co}", LogLevels.Debug);
LogEntry($"WebLogon.EnsureCoreWebView2Async Result: {webEnv}", LogLevels.Debug);
LogEntry($"webEnv.FailureReportFolderPath: {webEnv.FailureReportFolderPath}", LogLevels.Debug);
// start the logon page
StartForm();
}
catch (Exception ex)
{
LogEntry($"Ausnahme in {methodInfo.Name}: {ex.Message}", LogLevels.Debug);
LogException(ex);
}
finally
{
LogMethodEnd(methodInfo);
}
}
private string GetAccessToken(string _frag)
{
var _arrParameters = _frag.Split('&');
string _AccessToken = null;
foreach (var _arrParam in _arrParameters)
{
var _items = _arrParam.Split('=');
if(_items.Length == 2 && _items[0] == "#access_token")
_AccessToken = _items[1];
}
return _AccessToken;
}
private void WebLogon_NavigationStarting(object sender, Microsoft.Web.WebView2.Core.CoreWebView2NavigationStartingEventArgs e)
{
var CM = MethodBase.GetCurrentMethod();
LogMethodBegin(CM);
try
{
var _u = e.Uri;
Debug.WriteLine($"nav.start: {_u}");
var _uri = new Uri(_u);
var _host = _uri.Host.ToLowerInvariant();
var _path = _uri.LocalPath.ToLowerInvariant();
var _frag = _uri.Fragment;
var _query = _uri.Query;
string M42Code = null;
string M42State = null;
if (_frag == null)
_frag = "";
if (_host == _M42Server.ToLowerInvariant() && _path == "/wm/" && _query.Contains("code="))
{
var _tmpQuery = _query;
if (_tmpQuery.StartsWith("?"))
_tmpQuery = _tmpQuery.Remove(0, 1);
var _arrItems = _tmpQuery.Split('&');
foreach (var item in _arrItems)
{
var _props = item.Split('=');
if (_props.Length == 2)
{
switch (_props[0])
{
case "code":
M42Code = _props[1];
break;
case "state":
M42State = _props[1];
break;
}
}
}
WebLogon.Stop();
WebLogon.CoreWebView2.Navigate(_logonUrl.AbsoluteUri);
}
if (_frag != String.Empty)
{
AccessToken = GetAccessToken(_frag);
MainWindow.MainInstance._userIsAuthenticated = true;
if (MainWindow.MainInstance._initializedUiComponents)
{
MainWindow.MainInstance.InitTimer();
MainWindow.MainInstance.InitializeOrUpdateTrayMenu();
MainWindow.MainInstance.RefreshIcon.Visibility = Visibility.Visible;
}
AuthenticationCompleted?.Invoke(this, EventArgs.Empty);
this.Close();
}
}
catch (Exception E)
{
LogException(E);
}
finally
{
LogMethodEnd(CM);
}
}
private void Close_Text_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
AuthenticationCompleted?.Invoke(this, EventArgs.Empty);
this.Close();
}
private void Grid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
DragMove();
}
}
}

View File

@@ -0,0 +1,66 @@
<Window x:Class="C4IT_CustomerPanel.forms.AnnouncementForm"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="announcementForm"
Height="600"
Width="900"
ResizeMode="NoResize"
WindowStyle="None"
BorderBrush="Black"
BorderThickness="2"
PreviewMouseLeftButtonDown="LeftMouseDown_Event">
<Window.Effect>
<DropShadowEffect/>
</Window.Effect>
<Grid>
<StackPanel>
<TextBlock HorizontalAlignment="Right"
FontWeight="Bold"
FontSize="20"
PreviewMouseDown="OnCloseClicked"
Cursor="Hand"
Margin="0,0,10,0">X</TextBlock>
<StackPanel Orientation="Horizontal">
<StackPanel Background="#FFEAEAEA">
<Image Source="/C4IT_CustomerPanel;component/Resources/icons/light/appbar.newspaper.png" Style="{StaticResource ImageStyle}"/>
</StackPanel>
<StackPanel Orientation="Vertical" Background="#FFEAEAEA">
<TextBox Padding="5,5,0,0"
x:Name="TxtCreatedDate"
BorderBrush="{x:Null}"
HorizontalAlignment="left"
FontSize="14"
Background="#FFEAEAEA"
Width="875"
IsEnabled="False">asd</TextBox>
<TextBox Padding="5,10,0,10"
x:Name="TxtSubject"
FontSize="20"
BorderBrush="{x:Null}"
HorizontalAlignment="Left"
Width="875"
Background="#FFEAEAEA"
IsEnabled="False">subject</TextBox>
</StackPanel>
</StackPanel>
<Separator>
<Separator.Effect>
<DropShadowEffect Direction="320" ShadowDepth="4" Opacity="0.4"/>
</Separator.Effect>
</Separator>
<WebBrowser x:Name="WebMain"
Margin="0,4,0,0"
Height="475"
Width="880"
IsEnabled="False" />
</StackPanel>
</Grid>
</Window>

View File

@@ -0,0 +1,42 @@
using C4IT_CustomerPanel.libs;
using System;
namespace C4IT_CustomerPanel.forms
{
/// <summary>
/// Interaktionslogik für announcementForm.xaml
/// </summary>
public partial class AnnouncementForm
{
public AnnouncementForm()
{
InitializeComponent();
Left = FormHelper.CenterOfScreen().X;
Top = FormHelper.CenterOfScreen().Y;
}
private void LeftMouseDown_Event(object sender, EventArgs e)
{
this.DragMove();
}
public void UpdateForm(string createdDate, string subject, string main)
{
TxtCreatedDate.Text = createdDate;
TxtSubject.Text = subject;
WebMain.NavigateToString(main);
}
private void OnCloseClicked(object sender, EventArgs e)
{
Hide();
GC.Collect();
}
}
}

69
forms/configInfo.xaml Normal file
View File

@@ -0,0 +1,69 @@
<Window x:Class="C4IT_CustomerPanel.forms.ConfigInfo"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:resx="clr-namespace:C4IT_CustomerPanel.Properties"
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
Title="Konfiguration © Copyright"
Height="295" Width="500"
Icon="/Customer Panel;component/Resources/icons/logo_CustomerPanel.ico"
ResizeMode="NoResize">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="110*"/>
<ColumnDefinition Width="375*"/>
<ColumnDefinition Width="9*"/>
</Grid.ColumnDefinitions>
<Button Visibility="Hidden" Content="Reset Panel Position" PreviewMouseDown="Button_PreviewMouseDown" Margin="230,10,0,215" Grid.Column="1" Grid.ColumnSpan="2"/>
<StackPanel Orientation="Vertical" Grid.ColumnSpan="3">
<StackPanel Orientation="Horizontal">
<TextBlock Margin="20,20,0,0" Text="MatrixServer" TextDecorations="Underline" FontSize="14"></TextBlock>
<TextBlock Margin="20,20,0,0" x:Name="TxtMatrixServer"/>
</StackPanel>
<StackPanel>
<Separator></Separator>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="20,20,0,0" Text="Ticket Update interval" TextDecorations="Underline" FontSize="14"></TextBlock>
<TextBlock Margin="20,20,0,0" x:Name="TxtUpdateIntervalTickets"/>
</StackPanel>
<StackPanel>
<Separator></Separator>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="20,20,0,0" Text="Announcements Update Interval Regular" TextDecorations="Underline" FontSize="14"></TextBlock>
<TextBlock Margin="20,20,0,0" x:Name="TxtUpdateIntervalRegularAnnouncements"/>
</StackPanel>
<StackPanel>
<Separator></Separator>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="20,20,0,0" Text="Announcements Update Interval AdHoc" TextDecorations="Underline" FontSize="14"></TextBlock>
<TextBlock Margin="20,20,0,0" x:Name="TxtUpdateIntervalAdHocAnnouncements"/>
</StackPanel>
<StackPanel>
<Separator></Separator>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,40,0,0">
<TextBlock Margin="20,0,0,0" x:Name="TxtCopyRight" >
</TextBlock>
<TextBlock Margin="5,0,0,0">
<Hyperlink NavigateUri="http://www.consulting4it.de" RequestNavigate="Hyperlink_RequestNavigate">
Consulting4IT GmbH
</Hyperlink>
</TextBlock>
<Button Margin="-110,20,0,0" Content="Creative Commons" PreviewMouseDown="OnCcClicked"></Button>
<Image Margin="20,-25,0,0" Source="/Customer Panel;component/Resources/consulting4it-header1.png" Height="60" HorizontalAlignment="Right" />
</StackPanel>
</StackPanel>
</Grid>
</Window>

62
forms/configInfo.xaml.cs Normal file
View File

@@ -0,0 +1,62 @@
using System;
using System.Windows;
using C4IT_CustomerPanel.libs;
using System.Diagnostics;
namespace C4IT_CustomerPanel.forms
{
/// <summary>
/// Interaktionslogik für configInfo.xaml
/// </summary>
public partial class ConfigInfo
{
private ConfigClass conf;
public ConfigInfo()
{
InitializeComponent();
Left = FormHelper.CenterOfScreen().X;
Top = FormHelper.CenterOfScreen().Y;
Topmost = true;
Focus();
}
public void SetConfigInfo(ConfigClass config)
{
TxtMatrixServer.Text = config.GetMatrixServer(false);
TxtUpdateIntervalTickets.Text = config.GetTimerIntervalTicket().ToString();
TxtUpdateIntervalRegularAnnouncements.Text = config.GetTimerIntervalRegular().ToString();
TxtUpdateIntervalAdHocAnnouncements.Text = config.GetTimerIntervalAdHoc().ToString();
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
string version = fvi.ProductVersion;
TxtCopyRight.Text = "© Copyright " + DateTime.Now.Year ;
Title = Title + " " + DateTime.Now.Year + " / Version: "+version;
conf = config;
}
private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
{
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
e.Handled = true;
}
private void OnCcClicked(object sender, EventArgs e)
{
string cc = @"Icon Creator & Copyright - Austin Andrews (@templarian)
License - https://creativecommons.org/licenses/by/3.0/
Link to material - http://modernuiicons.com/
";
MessageBox.Show(cc,"Additional Copyrights");
}
private void Button_PreviewMouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
}
}
}