06.04.2022

This commit is contained in:
marcusferl@weifer.de 2022-04-06 09:06:42 +02:00
parent d082b406f2
commit 9a514dcb4e
5 changed files with 123 additions and 5 deletions

View File

@ -80,7 +80,7 @@ namespace Test_App
PingReply result = ping.Send(hostUrl); PingReply result = ping.Send(hostUrl);
online_status.Fill = Brushes.Green; online_status.Fill = Brushes.Green;
} }
catch (Exception ex) catch
{ {
online_status.Fill = Brushes.Red; online_status.Fill = Brushes.Red;
MessageBox.Show("Bitte deine Internetverbindung Prüfen und das Programm neu starten"); MessageBox.Show("Bitte deine Internetverbindung Prüfen und das Programm neu starten");

View File

@ -14,6 +14,22 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@ -34,6 +50,18 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>F428752E3690A0F5EA4BCE1CDFDE9E20C40F5A13</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>Test_App_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
@ -62,6 +90,9 @@
<Compile Include="Views\Database.xaml.cs"> <Compile Include="Views\Database.xaml.cs">
<DependentUpon>Database.xaml</DependentUpon> <DependentUpon>Database.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\Database_Info.xaml.cs">
<DependentUpon>Database_Info.xaml</DependentUpon>
</Compile>
<Compile Include="Views\HomeView.xaml.cs"> <Compile Include="Views\HomeView.xaml.cs">
<DependentUpon>HomeView.xaml</DependentUpon> <DependentUpon>HomeView.xaml</DependentUpon>
</Compile> </Compile>
@ -102,6 +133,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Views\Database_Info.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\HomeView.xaml"> <Page Include="Views\HomeView.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@ -143,6 +178,7 @@
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None> </None>
<None Include="Ressources\data.json" /> <None Include="Ressources\data.json" />
<None Include="Test_App_TemporaryKey.pfx" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />
@ -160,5 +196,17 @@
<ItemGroup> <ItemGroup>
<None Include="Readme.md" /> <None Include="Readme.md" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 und x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>

View File

@ -38,7 +38,7 @@ namespace Test_App.Views
{ {
json = webclient.DownloadString("https://git.weifer.org/weifer/Test_App/raw/branch/master/Test_App/Ressources/data.json"); json = webclient.DownloadString("https://git.weifer.org/weifer/Test_App/raw/branch/master/Test_App/Ressources/data.json");
} }
catch (System.Net.WebException e) catch
{ {
MainWindow.status.Fill = Brushes.Red; MainWindow.status.Fill = Brushes.Red;
MessageBox.Show("Server nicht erreichbar"); MessageBox.Show("Server nicht erreichbar");
@ -63,8 +63,11 @@ namespace Test_App.Views
private void itemOnClick(object sender, MouseButtonEventArgs e) private void itemOnClick(object sender, MouseButtonEventArgs e)
{ {
Ressources.Datas current = datalist.SelectedItem as Ressources.Datas; Ressources.Datas current = datalist.SelectedItem as Ressources.Datas;
Database_Info window = new Database_Info();
TextBox textBox = new TextBox(); window.Show();
/*TextBox textBox = new TextBox();
textBox.Style = (Style)FindResource("Custom_Window"); textBox.Style = (Style)FindResource("Custom_Window");
textBox.Text = "Antwort: \n" + current.Answer + "\n"; textBox.Text = "Antwort: \n" + current.Answer + "\n";
@ -73,7 +76,7 @@ namespace Test_App.Views
window.Height = 300; window.Height = 300;
window.SizeToContent = SizeToContent.WidthAndHeight; window.SizeToContent = SizeToContent.WidthAndHeight;
window.Content = textBox; window.Content = textBox;
window.Show(); window.Show();*/
} }
} }
} }

View File

@ -0,0 +1,28 @@
<Window x:Class="Test_App.Views.Database_Info"
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:local="clr-namespace:Test_App.Views"
mc:Ignorable="d"
Title="Database_Info" Height="300" Width="550"
Background="Transparent"
WindowStyle="None"
ResizeMode="NoResize"
AllowsTransparency="True"
MouseDown="Drag_Window"
Name="databse_info_window">
<Border Background="#232041" CornerRadius="30,60,30,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="300"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button Content="X" HorizontalAlignment="Left" Margin="483,10,0,0" VerticalAlignment="Top" Height="26" Width="29" Background="Transparent" Foreground="White" BorderBrush="{x:Null}" FontWeight="Bold" FontFamily="Tw Cen MT" FontSize="20" RenderTransformOrigin="-0.258,0.549" Click="close_window"/>
<TextBox x:Name="database_info_window_textbox" HorizontalAlignment="Center" Margin="0,41,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="494" Height="236" Style="{StaticResource Custom_Window}" BorderBrush="{x:Null}" SelectionBrush="{x:Null}" Focusable="False"/>
</Grid>
</Border>
</Window>

View File

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
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;
namespace Test_App.Views
{
/// <summary>
/// Interaktionslogik für Database_Info.xaml
/// </summary>
public partial class Database_Info : Window
{
public Database_Info()
{
InitializeComponent();
}
private void Drag_Window(object sender, MouseButtonEventArgs e)
{
if (e.ChangedButton == MouseButton.Left)
this.DragMove();
}
private void close_window(object sender, RoutedEventArgs e)
{
var window = Application.Current.Windows.OfType<Window>().SingleOrDefault(x => x.IsActive);
window.Close();
}
}
}