Compare commits
13 Commits
8ac2eeabdf
...
main
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9274f8b609 | ||
![]() |
7926c808af | ||
![]() |
39cda1170e | ||
![]() |
c390dfe5e3 | ||
![]() |
4edc2f2188 | ||
![]() |
fd2ebc5aaa | ||
![]() |
8b71f84284 | ||
![]() |
f9d5053029 | ||
![]() |
d9976ff520 | ||
![]() |
ce490cf68f | ||
![]() |
eb97a29912 | ||
![]() |
96fbb4498d | ||
![]() |
ab0ac8597d |
BIN
Bib_Talk_Entwurfsdokumentation.pdf
Normal file
BIN
Bib_Talk_Entwurfsdokumentation.pdf
Normal file
Binary file not shown.
BIN
Projekt Dokumentation.pdf
Normal file
BIN
Projekt Dokumentation.pdf
Normal file
Binary file not shown.
BIN
Testdokumentation bib-Talk.pdf
Normal file
BIN
Testdokumentation bib-Talk.pdf
Normal file
Binary file not shown.
20
bibtalk/UnitTestProject1/Properties/AssemblyInfo.cs
Normal file
20
bibtalk/UnitTestProject1/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
[assembly: AssemblyTitle("UnitTestProject1")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("UnitTestProject1")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2024")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
[assembly: Guid("5ab576d6-0fab-4721-acc8-e94e9cdba4bc")]
|
||||||
|
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
14
bibtalk/UnitTestProject1/UnitTest1.cs
Normal file
14
bibtalk/UnitTestProject1/UnitTest1.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace UnitTestProject1
|
||||||
|
{
|
||||||
|
[TestClass]
|
||||||
|
public class UnitTest1
|
||||||
|
{
|
||||||
|
[TestMethod]
|
||||||
|
public void TestMethod1()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
68
bibtalk/UnitTestProject1/UnitTestProject1.csproj
Normal file
68
bibtalk/UnitTestProject1/UnitTestProject1.csproj
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.props')" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{5AB576D6-0FAB-4721-ACC8-E94E9CDBA4BC}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>UnitTestProject1</RootNamespace>
|
||||||
|
<AssemblyName>UnitTestProject1</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
|
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
|
||||||
|
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||||
|
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
||||||
|
<IsCodedUITest>False</IsCodedUITest>
|
||||||
|
<TestProjectType>UnitTest</TestProjectType>
|
||||||
|
<NuGetPackageImportStamp>
|
||||||
|
</NuGetPackageImportStamp>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="UnitTest1.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.props'))" />
|
||||||
|
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.targets'))" />
|
||||||
|
</Target>
|
||||||
|
<Import Project="..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.targets')" />
|
||||||
|
</Project>
|
5
bibtalk/UnitTestProject1/packages.config
Normal file
5
bibtalk/UnitTestProject1/packages.config
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="MSTest.TestAdapter" version="2.2.10" targetFramework="net472" />
|
||||||
|
<package id="MSTest.TestFramework" version="2.2.10" targetFramework="net472" />
|
||||||
|
</packages>
|
20
bibtalk/UnitTestProject2/Properties/AssemblyInfo.cs
Normal file
20
bibtalk/UnitTestProject2/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
[assembly: AssemblyTitle("UnitTestProject2")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("UnitTestProject2")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2024")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
[assembly: Guid("2206e204-1087-4204-b79d-1880c23798eb")]
|
||||||
|
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
15
bibtalk/UnitTestProject2/UnitTest1.cs
Normal file
15
bibtalk/UnitTestProject2/UnitTest1.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace UnitTestProject2
|
||||||
|
{
|
||||||
|
[TestClass]
|
||||||
|
public class UnitTest1
|
||||||
|
{
|
||||||
|
[TestMethod]
|
||||||
|
public void TestMethod1()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
74
bibtalk/UnitTestProject2/UnitTestProject2.csproj
Normal file
74
bibtalk/UnitTestProject2/UnitTestProject2.csproj
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.props')" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{2206E204-1087-4204-B79D-1880C23798EB}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>UnitTestProject2</RootNamespace>
|
||||||
|
<AssemblyName>UnitTestProject2</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
|
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
|
||||||
|
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||||
|
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
||||||
|
<IsCodedUITest>False</IsCodedUITest>
|
||||||
|
<TestProjectType>UnitTest</TestProjectType>
|
||||||
|
<NuGetPackageImportStamp>
|
||||||
|
</NuGetPackageImportStamp>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="UnitTest1.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\bib-talk\bib-talk.csproj">
|
||||||
|
<Project>{92b3214e-6fb1-4d94-b93f-6f1a9d9f2224}</Project>
|
||||||
|
<Name>bib-talk</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.props'))" />
|
||||||
|
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.targets'))" />
|
||||||
|
</Target>
|
||||||
|
<Import Project="..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.targets')" />
|
||||||
|
</Project>
|
5
bibtalk/UnitTestProject2/packages.config
Normal file
5
bibtalk/UnitTestProject2/packages.config
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="MSTest.TestAdapter" version="2.2.10" targetFramework="net472" />
|
||||||
|
<package id="MSTest.TestFramework" version="2.2.10" targetFramework="net472" />
|
||||||
|
</packages>
|
1
bibtalk/UserTest/GlobalUsings.cs
Normal file
1
bibtalk/UserTest/GlobalUsings.cs
Normal file
@@ -0,0 +1 @@
|
|||||||
|
global using Microsoft.VisualStudio.TestTools.UnitTesting;
|
11
bibtalk/UserTest/UnitTest1.cs
Normal file
11
bibtalk/UserTest/UnitTest1.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
namespace UserTest
|
||||||
|
{
|
||||||
|
[TestClass]
|
||||||
|
public class UnitTest1
|
||||||
|
{
|
||||||
|
[TestMethod]
|
||||||
|
public void TestMethod1()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
23
bibtalk/UserTest/UserTest.csproj
Normal file
23
bibtalk/UserTest/UserTest.csproj
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
|
||||||
|
<IsPackable>false</IsPackable>
|
||||||
|
<IsTestProject>true</IsTestProject>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
|
||||||
|
<PackageReference Include="MSTest.TestAdapter" Version="3.0.4" />
|
||||||
|
<PackageReference Include="MSTest.TestFramework" Version="3.0.4" />
|
||||||
|
<PackageReference Include="coverlet.collector" Version="6.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\bib-talk\bib-talk.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
BIN
bibtalk/UserTests/Fakes/bib-talk.fakes
Normal file
BIN
bibtalk/UserTests/Fakes/bib-talk.fakes
Normal file
Binary file not shown.
1
bibtalk/UserTests/GlobalUsings.cs
Normal file
1
bibtalk/UserTests/GlobalUsings.cs
Normal file
@@ -0,0 +1 @@
|
|||||||
|
global using Microsoft.VisualStudio.TestTools.UnitTesting;
|
12
bibtalk/UserTests/UnitTest1.cs
Normal file
12
bibtalk/UserTests/UnitTest1.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
namespace UserTests
|
||||||
|
{
|
||||||
|
[TestClass]
|
||||||
|
public class UnitTest1
|
||||||
|
{
|
||||||
|
[TestMethod]
|
||||||
|
public void TestMethod1()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
34
bibtalk/UserTests/UserTests.csproj
Normal file
34
bibtalk/UserTests/UserTests.csproj
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
|
||||||
|
<IsPackable>false</IsPackable>
|
||||||
|
<IsTestProject>true</IsTestProject>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="FakesAssemblies\**" />
|
||||||
|
<EmbeddedResource Remove="FakesAssemblies\**" />
|
||||||
|
<None Remove="FakesAssemblies\**" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
|
||||||
|
<PackageReference Include="Microsoft.QualityTools.Testing.Fakes" Version="16.11.230815" />
|
||||||
|
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
|
||||||
|
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
|
||||||
|
<PackageReference Include="coverlet.collector" Version="3.2.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\bib-talk\bib-talk.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<AdditionalDesignTimeBuildInput Remove="FakesAssemblies\**" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||||||
# Visual Studio Version 17
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 17.4.33213.308
|
VisualStudioVersion = 17.4.33213.308
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bib-talk", "bib-talk\bib-talk.csproj", "{92B3214E-6FB1-4D94-B93F-6F1A9D9F2224}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "bib-talk", "bib-talk\bib-talk.csproj", "{92B3214E-6FB1-4D94-B93F-6F1A9D9F2224}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
@@ -1,19 +1,52 @@
|
|||||||
using bib_talk.Repository;
|
using bib_talk.Repository;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
namespace bib_talk.Business
|
namespace bib_talk.Business
|
||||||
{
|
{
|
||||||
public class LoginManager
|
public class LoginManager
|
||||||
{
|
{
|
||||||
private LoginDatabase loginDatabase;
|
private LoginDatabase loginDatabase; // LoginDatabase Objekt initialisieren
|
||||||
|
|
||||||
|
// Konstruktor für den LoginManager
|
||||||
public LoginManager(Login loginWindow)
|
public LoginManager(Login loginWindow)
|
||||||
{
|
{
|
||||||
loginDatabase = new LoginDatabase(loginWindow);
|
loginDatabase = new LoginDatabase(loginWindow); // LoginDatabase Objekt deklarieren
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode zum User einloggen via LoginDatabase
|
||||||
public async void Login()
|
public async void Login()
|
||||||
{
|
{
|
||||||
await loginDatabase.LoginServer();
|
await loginDatabase.LoginServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DEBUG METHODE
|
||||||
|
// Methode um Bots einzuloggen
|
||||||
|
//public async Task LoginBots(string username, string password)
|
||||||
|
//{
|
||||||
|
// var loginData = new { Username = username, Password = password, Email = "", Birthday = "", IsOnline = "" };
|
||||||
|
// string json = JsonConvert.SerializeObject(loginData);
|
||||||
|
|
||||||
|
// using (var client = new HttpClient())
|
||||||
|
// {
|
||||||
|
// var content = new StringContent(json, Encoding.UTF8, "application/json");
|
||||||
|
// var response = await client.PostAsync("http://daddypig.dns.navy:5114/api/users/login", content);
|
||||||
|
|
||||||
|
// if (response.IsSuccessStatusCode)
|
||||||
|
// {
|
||||||
|
// var responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
// var responseData = JsonConvert.DeserializeObject<dynamic>(responseContent);
|
||||||
|
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// var responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
// MessageBox.Show($"Login failed: {responseContent}");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -5,41 +5,48 @@ namespace bib_talk.Business
|
|||||||
{
|
{
|
||||||
public class MainWindowManager
|
public class MainWindowManager
|
||||||
{
|
{
|
||||||
private MainWindowDatabase mwDatabase;
|
private MainWindowDatabase mwDatabase; //MainWindowDatabase initializeren
|
||||||
private string loggedinUser;
|
private string loggedInUser; // Feld um eingeloggten User zu speichern
|
||||||
|
|
||||||
public MainWindowManager(MainWindow mainWindow)
|
|
||||||
{
|
|
||||||
mwDatabase = new MainWindowDatabase(mainWindow);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Konstruktor für MainWindowManager mit MainWindow und User Referenz
|
||||||
public MainWindowManager(MainWindow mainWindow, string user)
|
public MainWindowManager(MainWindow mainWindow, string user)
|
||||||
{
|
{
|
||||||
mwDatabase = new MainWindowDatabase(mainWindow, user);
|
mwDatabase = new MainWindowDatabase(mainWindow, user);
|
||||||
loggedinUser = user;
|
loggedInUser = user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode zum Senden einer Nachricht via Datenbankmanager
|
||||||
public void SendMessage()
|
public void SendMessage()
|
||||||
{
|
{
|
||||||
mwDatabase.SendMessage();
|
mwDatabase.SendMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode zum Laden der Nachrichten via Datenbankmanager
|
||||||
public void LoadMessages()
|
public void LoadMessages()
|
||||||
{
|
{
|
||||||
mwDatabase.LoadMessages();
|
mwDatabase.LoadMessages();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode zum Laden der Online Benutzer via Datenbankmanager
|
||||||
public void LoadOnlineUsers()
|
public void LoadOnlineUsers()
|
||||||
{
|
{
|
||||||
mwDatabase.LoadOnlineUsers();
|
mwDatabase.LoadOnlineUsers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode zum Ausloggen des Users via Datenbankmanager
|
||||||
public void LogoutUser()
|
public void LogoutUser()
|
||||||
{
|
{
|
||||||
mwDatabase.LogoutUser();
|
mwDatabase.LogoutUser();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task UploadProfileImage(string filePath)
|
// Methode zum Löschen des Gesamten Chats
|
||||||
|
public void DeleteMessages()
|
||||||
|
{
|
||||||
|
mwDatabase.ClearMessages();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Methode zum Hochladen eines Profilbildes via Datenbankmanager
|
||||||
|
public async Task UploadProfileImage(string filePath)
|
||||||
{
|
{
|
||||||
await mwDatabase.UploadProfileImage(filePath);
|
await mwDatabase.UploadProfileImage(filePath);
|
||||||
}
|
}
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace bib_talk.Business
|
namespace bib_talk.Business
|
||||||
{
|
{
|
||||||
|
// Klasse um die Nachrichten in der Datenbank zu speichern
|
||||||
public class Message
|
public class Message
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace bib_talk.Business
|
namespace bib_talk.Business
|
||||||
{
|
{
|
||||||
|
// Klasse damit die Nachrichten in der App benutzt werden können
|
||||||
public class MessageDto
|
public class MessageDto
|
||||||
{
|
{
|
||||||
public string Username { get; set; }
|
public string Username { get; set; }
|
||||||
|
@@ -1,19 +1,49 @@
|
|||||||
using bib_talk.Repository;
|
using bib_talk.Repository;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
namespace bib_talk.Business
|
namespace bib_talk.Business
|
||||||
{
|
{
|
||||||
public class RegisterManager
|
public class RegisterManager
|
||||||
{
|
{
|
||||||
private RegisterDatabase registerDatabase;
|
private RegisterDatabase registerDatabase; // RegisterDatabase Objekt initialisieren
|
||||||
|
|
||||||
|
// Konstruktor für den RegisterManager
|
||||||
public RegisterManager(RegisterWindow registerWindow)
|
public RegisterManager(RegisterWindow registerWindow)
|
||||||
{
|
{
|
||||||
registerDatabase = new RegisterDatabase(registerWindow);
|
registerDatabase = new RegisterDatabase(registerWindow); // RegisterDatabase Objekt deklarieren
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode um einen neuen Nutzer zu Registrieren via der RegisterDatabase
|
||||||
public async void RegisterServer()
|
public async void RegisterServer()
|
||||||
{
|
{
|
||||||
await registerDatabase.RegisterServer();
|
await registerDatabase.RegisterServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// DEBUG METHODE
|
||||||
|
// Methode um einen Bot Nutzer auf der Datenbank anzulegen
|
||||||
|
public async void RegisterBots(string username, string password, string email, string birthday)
|
||||||
|
{
|
||||||
|
var newUser = new { Username = username, Password = password, Email = email, Birthday = birthday, IsOnline = "" };
|
||||||
|
string json = JsonConvert.SerializeObject(newUser);
|
||||||
|
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
var content = new StringContent(json, Encoding.UTF8, "application/json");
|
||||||
|
var response = await client.PostAsync("http://daddypig.dns.navy:5114/api/users/register", content);
|
||||||
|
|
||||||
|
if (response.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Registrierung erfolgreich.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Registrierung fehlgeschlagen. " + response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,8 @@
|
|||||||
namespace bib_talk.Business
|
namespace bib_talk.Business
|
||||||
{
|
{
|
||||||
|
// User Klasse mit den Eigenschaften Id, Username, Password,
|
||||||
|
// Email, Birthday, IsOnline und ProfileImagePath
|
||||||
|
// um diese in der App zu Benutzen und in der Datenbank zu speichern
|
||||||
public class User
|
public class User
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
@@ -8,13 +8,15 @@ namespace bib_talk.Repository
|
|||||||
{
|
{
|
||||||
public class LoginDatabase
|
public class LoginDatabase
|
||||||
{
|
{
|
||||||
Login loginWindow;
|
Login loginWindow; // Login Window initialisieren
|
||||||
|
|
||||||
|
// Konstruker der LoginDatabase
|
||||||
public LoginDatabase(Login loginWindow)
|
public LoginDatabase(Login loginWindow)
|
||||||
{
|
{
|
||||||
this.loginWindow = loginWindow;
|
this.loginWindow = loginWindow; // Login Window deklarieren
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode um den User einzuloggen via eines Server aufrufs
|
||||||
public async Task LoginServer()
|
public async Task LoginServer()
|
||||||
{
|
{
|
||||||
string username = loginWindow.usernbox.Text;
|
string username = loginWindow.usernbox.Text;
|
||||||
|
@@ -12,28 +12,25 @@ namespace bib_talk.Repository
|
|||||||
{
|
{
|
||||||
public class MainWindowDatabase
|
public class MainWindowDatabase
|
||||||
{
|
{
|
||||||
private MainWindow mainWindow;
|
private MainWindow mainWindow; // MainWindow initialisieren
|
||||||
private string loggedinUser;
|
private string loggedinUser; // Feld um eingeloggten User zu speichern
|
||||||
|
|
||||||
public MainWindowDatabase(MainWindow mainWindow)
|
|
||||||
{
|
|
||||||
this.mainWindow = mainWindow;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Konstruktor für MainWindowDatabase mit MainWindow und User Referenz
|
||||||
public MainWindowDatabase(MainWindow mainWindow, string user)
|
public MainWindowDatabase(MainWindow mainWindow, string user)
|
||||||
{
|
{
|
||||||
this.mainWindow = mainWindow;
|
this.mainWindow = mainWindow;
|
||||||
loggedinUser = user;
|
loggedinUser = user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode zum Senden einer Nachricht via Datenbank
|
||||||
public async void SendMessage()
|
public async void SendMessage()
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(mainWindow.messageBOX.Text))
|
if (!string.IsNullOrEmpty(mainWindow.messageBox.Text))
|
||||||
{
|
{
|
||||||
var message = new MessageDto
|
var message = new MessageDto
|
||||||
{
|
{
|
||||||
Username = mainWindow.loggedinUser,
|
Username = mainWindow.loggedinUser,
|
||||||
Message = mainWindow.messageBOX.Text,
|
Message = mainWindow.messageBox.Text,
|
||||||
Timestamp = DateTime.Now,
|
Timestamp = DateTime.Now,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -45,13 +42,14 @@ namespace bib_talk.Repository
|
|||||||
|
|
||||||
if (response.IsSuccessStatusCode)
|
if (response.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
mainWindow.messageBOX.Clear();
|
mainWindow.messageBox.Clear();
|
||||||
LoadMessages(); // Reload messages after sending
|
LoadMessages(); // Reload messages after sending
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode zum Laden der Nachrichten via Datenbank
|
||||||
public async void LoadMessages()
|
public async void LoadMessages()
|
||||||
{
|
{
|
||||||
using (var client = new HttpClient())
|
using (var client = new HttpClient())
|
||||||
@@ -71,6 +69,7 @@ namespace bib_talk.Repository
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode zum Laden der Online Benutzer via Datenbank
|
||||||
public async void LoadOnlineUsers()
|
public async void LoadOnlineUsers()
|
||||||
{
|
{
|
||||||
using (var client = new HttpClient())
|
using (var client = new HttpClient())
|
||||||
@@ -88,6 +87,32 @@ namespace bib_talk.Repository
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode zum Löschen des Gesamten Chats via Datenbank
|
||||||
|
public async void ClearMessages()
|
||||||
|
{
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var response = await client.DeleteAsync("http://daddypig.dns.navy:5114/api/messages/clear");
|
||||||
|
|
||||||
|
if (response.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Alle Nachrichten wurden gelöscht");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show($"Fehler beim Löschen der Nachrichten. Status code: {response.StatusCode}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Ein Fehler ist aufgetreten: {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Methode zum Ausloggen des Users via Datenbank
|
||||||
public async void LogoutUser()
|
public async void LogoutUser()
|
||||||
{
|
{
|
||||||
using (var client = new HttpClient())
|
using (var client = new HttpClient())
|
||||||
@@ -104,6 +129,7 @@ namespace bib_talk.Repository
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode zum Hochladen eines Profilbildes via Datenbank
|
||||||
public async Task UploadProfileImage(string filePath)
|
public async Task UploadProfileImage(string filePath)
|
||||||
{
|
{
|
||||||
using (var client = new HttpClient())
|
using (var client = new HttpClient())
|
||||||
|
@@ -8,13 +8,16 @@ namespace bib_talk.Repository
|
|||||||
{
|
{
|
||||||
public class RegisterDatabase
|
public class RegisterDatabase
|
||||||
{
|
{
|
||||||
RegisterWindow registerWindow;
|
RegisterWindow registerWindow; // RegisterWindow initailisieren
|
||||||
|
|
||||||
|
// Konstruktor für die RegisterDatabase
|
||||||
public RegisterDatabase(RegisterWindow registerWindow)
|
public RegisterDatabase(RegisterWindow registerWindow)
|
||||||
{
|
{
|
||||||
this.registerWindow = registerWindow;
|
this.registerWindow = registerWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode um einen Nutzer zu registrieren und die Daten
|
||||||
|
// in die Datenbank zu schreiben
|
||||||
public async Task RegisterServer()
|
public async Task RegisterServer()
|
||||||
{
|
{
|
||||||
string username = registerWindow.usernbox.Text;
|
string username = registerWindow.usernbox.Text;
|
||||||
|
@@ -101,7 +101,7 @@
|
|||||||
Margin="0,30,0,0"
|
Margin="0,30,0,0"
|
||||||
Background="#FF323134"
|
Background="#FF323134"
|
||||||
Foreground="White"
|
Foreground="White"
|
||||||
SelectionBrush="#FF6332A0"/>
|
SelectionBrush="#FF6332A0" KeyDown="userNameBox_KeyDown"/>
|
||||||
|
|
||||||
<!-- Benutzername TextBox -->
|
<!-- Benutzername TextBox -->
|
||||||
<TextBlock Text="Passwort"
|
<TextBlock Text="Passwort"
|
||||||
@@ -117,15 +117,15 @@
|
|||||||
Margin="0,30,0,0"
|
Margin="0,30,0,0"
|
||||||
Background="#FF323134"
|
Background="#FF323134"
|
||||||
Foreground="White"
|
Foreground="White"
|
||||||
SelectionBrush="#FF6332A0"/>
|
SelectionBrush="#FF6332A0" KeyDown="passwordbox_KeyDown"/>
|
||||||
<Button x:Name="weiterbutton" Content="Weiter" Foreground="Gray" Background="#FF323134" BorderThickness="0" Margin="0,30,0,0" Height="30" BorderBrush="{x:Null}" Click="WeiterButton_Click" Style="{StaticResource NoHoverButtonStyle}"/>
|
<Button x:Name="weiterbutton" Content="Weiter" Foreground="Gray" Background="#FF323134" BorderThickness="0" Margin="0,30,0,0" Height="30" BorderBrush="{x:Null}" Click="WeiterButton_Click" Style="{StaticResource NoHoverButtonStyle}"/>
|
||||||
<TextBlock Text="Noch keinen Account?"
|
<TextBlock Text="Noch keinen Account?"
|
||||||
Foreground="White"
|
Foreground="White"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
Width="136"
|
Width="136"
|
||||||
Margin="20,20,0,0"/>
|
Margin="20,20,0,0"/>
|
||||||
<Button Style="{StaticResource InvisibleButtonStyle}" Click="Register_Click">
|
<Button x:Name="RegisterButton" Style="{StaticResource InvisibleButtonStyle}" Click="Register_Click">
|
||||||
<TextBlock Text="Registrieren"
|
<TextBlock x:Name="RegisterTextBlock" Text="Registrieren"
|
||||||
Foreground="#FF6332A0"
|
Foreground="#FF6332A0"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
Width="66"
|
Width="66"
|
||||||
@@ -134,6 +134,6 @@
|
|||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</Window>
|
</Window>
|
||||||
|
@@ -2,6 +2,8 @@
|
|||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using bib_talk.Business;
|
using bib_talk.Business;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
namespace bib_talk
|
namespace bib_talk
|
||||||
{
|
{
|
||||||
@@ -9,16 +11,17 @@ namespace bib_talk
|
|||||||
{
|
{
|
||||||
LoginManager loginManager;
|
LoginManager loginManager;
|
||||||
|
|
||||||
// Field to store logged in user
|
public static string loggedInUser; // Feld um eingeloggten User zu speichern
|
||||||
public static string loggedInUser;
|
|
||||||
|
|
||||||
public Login()
|
// Konstruktor für das Login Fenster
|
||||||
|
public Login()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
loginManager = new LoginManager(this);
|
loginManager = new LoginManager(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode für Custom Draggable Area
|
||||||
private void DraggableArea_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
private void DraggableArea_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.ButtonState == MouseButtonState.Pressed)
|
if (e.ButtonState == MouseButtonState.Pressed)
|
||||||
@@ -27,18 +30,13 @@ namespace bib_talk
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode um das Fenster zu schließen
|
||||||
private void CloseButton_Click(object sender, RoutedEventArgs e)
|
private void CloseButton_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Button_Click(object sender, RoutedEventArgs e)
|
// Methode um den User einzuloggen
|
||||||
{
|
|
||||||
RegisterWindow register = new RegisterWindow();
|
|
||||||
register.Show();
|
|
||||||
this.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void WeiterButton_Click(object sender, RoutedEventArgs e)
|
private async void WeiterButton_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (usernbox.Text != "" && passwordbox.Password != "")
|
if (usernbox.Text != "" && passwordbox.Password != "")
|
||||||
@@ -47,6 +45,7 @@ namespace bib_talk
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode um den Weiter Button zu Aktivieren, wenn ein Nutzername und Passwort eingegeben ist
|
||||||
private void passwordbox_PasswordChanged(object sender, RoutedEventArgs e)
|
private void passwordbox_PasswordChanged(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (usernbox.Text != "" && passwordbox.Password != "")
|
if (usernbox.Text != "" && passwordbox.Password != "")
|
||||||
@@ -63,11 +62,49 @@ namespace bib_talk
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode um das Registrierungs Fenster zu öffnen
|
||||||
private void Register_Click(object sender, RoutedEventArgs e)
|
private void Register_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
RegisterWindow register = new RegisterWindow();
|
RegisterWindow register = new RegisterWindow();
|
||||||
register.Show();
|
register.Show();
|
||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// Methode um via der Enter Taste zum nächsten Feld zu springen
|
||||||
|
private void userNameBox_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Key == Key.Enter)
|
||||||
|
{
|
||||||
|
passwordbox.Focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Methode um via der Enter Taste den User einzuloggen
|
||||||
|
private void passwordbox_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Key == Key.Enter)
|
||||||
|
{
|
||||||
|
if (usernbox.Text != "" && passwordbox.Password != "")
|
||||||
|
{
|
||||||
|
loginManager.Login();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Debug Methode um 100 Bot User einzuloggen
|
||||||
|
// Man fügt die Methode einem Button hinzu und ruft sie als Button Click Event auf
|
||||||
|
|
||||||
|
//private void LoginBotUser(object sender, RoutedEventArgs e)
|
||||||
|
//{
|
||||||
|
// for (int i = 1; i <= 100; i++)
|
||||||
|
// {
|
||||||
|
// string name = "Bot";
|
||||||
|
// string password = "Bot123";
|
||||||
|
// loginManager.LoginBots(name + i, password);
|
||||||
|
// Thread.Sleep(1000);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -85,37 +85,32 @@
|
|||||||
VerticalAlignment="Top"/>
|
VerticalAlignment="Top"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Grid Margin="298,17,0,176" Grid.ColumnSpan="4">
|
<Grid Margin="298,17,0,176" Grid.ColumnSpan="4">
|
||||||
|
|
||||||
|
|
||||||
<Popup x:Name="popup" Placement="Center" IsOpen="False" LostFocus="Popup_LostFocus">
|
|
||||||
<StackPanel Background="White" Orientation="Vertical" Width="200" Height="150" Margin="10">
|
|
||||||
<Button Content="Button 1" Click="Button1_Click" Margin="5"/>
|
|
||||||
<Button Content="Button 2" Click="Button2_Click" Margin="5"/>
|
|
||||||
<Button Content="Button 3" Click="Button3_Click" Margin="5"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Popup>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<Rectangle Stroke="#FF6332A0" Fill="#FF6332A0" Width="682"/>
|
<Rectangle Stroke="#FF6332A0" Fill="#FF6332A0" Width="682"/>
|
||||||
<TextBlock Text="Global Chat" Margin="108,25,206,21" FontSize="40" Foreground="White" />
|
<TextBlock Text="Global Chat" Margin="108,25,206,21" FontSize="40" Foreground="White" />
|
||||||
<Image Source="/UI/logo - Copy.png" Stretch="Fill" Margin="-55,-118,499,0">
|
<Image Source="/UI/logo - Copy.png" Stretch="Fill" Margin="-55,-118,499,0">
|
||||||
|
|
||||||
</Image>
|
</Image>
|
||||||
<Button Content="⋮" HorizontalAlignment="Left" Margin="638,8,0,0" VerticalAlignment="Top" Width="19" Height="70" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="White" FontSize="58" Click="ChatFenster_Click"/>
|
<Button x:Name="ChatSettings" Content="⚙️" Click="MenuButton_Click" HorizontalAlignment="Left" Margin="634,2,0,0" VerticalAlignment="Top" Height="37" Width="26" Background="Transparent" BorderBrush="Transparent">
|
||||||
</Grid>
|
<Button.ContextMenu>
|
||||||
|
<ContextMenu x:Name="contextMenu" IsOpen="False">
|
||||||
|
<MenuItem x:Name="muteChatButton" Header="Chat muten" Click="muteChatButton_Click"/>
|
||||||
|
<MenuItem x:Name="clearChatButton" Header="Clear chat" Click="clearChatButton_Click"/>
|
||||||
|
<MenuItem x:Name="helpButton" Header="Help" Click="helpButton_Click"/>
|
||||||
|
</ContextMenu>
|
||||||
|
</Button.ContextMenu>
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
<Grid Margin="76,17,339,176">
|
<Grid Margin="76,17,339,176">
|
||||||
|
|
||||||
<Rectangle Stroke="#FF282828" Fill="#FF282828"/>
|
<Rectangle Stroke="#FF282828" Fill="#FF282828"/>
|
||||||
<TextBlock Text="Chats" Foreground="White" FontSize="22" Margin="10,18,134,39" />
|
<TextBlock Text="Chats" Foreground="White" FontSize="22" Margin="10,18,134,39" />
|
||||||
<TextBox
|
<TextBox
|
||||||
FontSize="20"
|
FontSize="20"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent"
|
||||||
Margin="10,61,10,10"
|
Margin="10,61,10,10"
|
||||||
Background="#FF6332A0"
|
Background="#FF6332A0"
|
||||||
Foreground="White"
|
Foreground="White"
|
||||||
SelectionBrush="#FF6332A0" KeyDown="messageBOX_KeyDown" RenderTransformOrigin="0.5,0.5">
|
SelectionBrush="#FF6332A0" RenderTransformOrigin="0.5,0.5">
|
||||||
<TextBox.RenderTransform>
|
<TextBox.RenderTransform>
|
||||||
<TransformGroup>
|
<TransformGroup>
|
||||||
<ScaleTransform ScaleX="-1" ScaleY="-1"/>
|
<ScaleTransform ScaleX="-1" ScaleY="-1"/>
|
||||||
@@ -147,14 +142,14 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
<TextBlock HorizontalAlignment="Left" x:Name="loggedinuser" Margin="0,-3,0,0" TextWrapping="Wrap" Text="xxxx" VerticalAlignment="Top" Height="20" Width="184" Foreground="White" RenderTransformOrigin="0.6,0.591"/>
|
<TextBlock HorizontalAlignment="Left" x:Name="loggedInUser" Margin="0,-3,0,0" TextWrapping="Wrap" Text="xxxx" VerticalAlignment="Top" Height="20" Width="184" Foreground="White" RenderTransformOrigin="0.6,0.591"/>
|
||||||
<ListBox x:Name="chatlistbox" Margin="298,112,0,50" d:ItemsSource="{d:SampleData ItemCount=5}" Background="#FF323134" BorderBrush="{x:Null}" Foreground="#FF6332A0" ScrollViewer.VerticalScrollBarVisibility="Hidden" ScrollViewer.HorizontalScrollBarVisibility="Hidden" Grid.ColumnSpan="4" Grid.RowSpan="2">
|
<ListBox x:Name="chatlistbox" Margin="298,112,0,50" d:ItemsSource="{d:SampleData ItemCount=5}" Background="#FF323134" BorderBrush="{x:Null}" Foreground="#FF6332A0" ScrollViewer.VerticalScrollBarVisibility="Hidden" ScrollViewer.HorizontalScrollBarVisibility="Hidden" Grid.ColumnSpan="4" Grid.RowSpan="2">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<StackPanel Margin="5">
|
<StackPanel Margin="5">
|
||||||
<TextBlock Text="{Binding Username}" FontWeight="Bold" FontSize="20"/>
|
<TextBlock Text="{Binding Username}" FontWeight="Bold" FontSize="20"/>
|
||||||
<TextBlock Text="{Binding Timestamp, StringFormat='{}{0:yyyy-MM-dd HH:mm:ss}'}" Foreground="Gray"/>
|
<TextBlock Text="{Binding Timestamp, StringFormat='{}{0:yyyy-MM-dd HH:mm:ss}'}" Foreground="Gray"/>
|
||||||
<TextBlock TextWrapping="Wrap" Text="{Binding Text}" FontSize="16"/>
|
<TextBlock TextWrapping="Wrap" Text="{Binding Text}" FontSize="16" Foreground="White"/>
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
@@ -165,14 +160,14 @@
|
|||||||
</ListBox>
|
</ListBox>
|
||||||
|
|
||||||
<TextBox
|
<TextBox
|
||||||
x:Name="messageBOX"
|
x:Name="messageBox"
|
||||||
FontSize="20"
|
FontSize="20"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent"
|
||||||
Margin="298,346,76,0"
|
Margin="298,346,76,0"
|
||||||
Background="#FF323134"
|
Background="#FF323134"
|
||||||
Foreground="White"
|
Foreground="White"
|
||||||
SelectionBrush="#FF6332A0" KeyDown="messageBOX_KeyDown" Grid.ColumnSpan="4" Grid.Row="1"/>
|
SelectionBrush="#FF6332A0" KeyDown="messageBox_KeyDown" Grid.ColumnSpan="4" Grid.Row="1"/>
|
||||||
<Button x:Name="weiterbutton" Click="send_Click" Content="Weiter" Foreground="White" Background="#FF6332A0" BorderThickness="0" Margin="44,346,10,10" BorderBrush="{x:Null}" Style="{StaticResource NoHoverButtonStyle}" RenderTransformOrigin="0.279,0.633" Grid.Column="3" Grid.Row="1"/>
|
<Button x:Name="weiterbutton" Click="send_Click" Content="Weiter" Foreground="White" Background="#FF6332A0" BorderThickness="0" Margin="44,346,10,0" BorderBrush="{x:Null}" Style="{StaticResource NoHoverButtonStyle}" RenderTransformOrigin="0.279,0.633" Grid.Column="3" Grid.Row="1"/>
|
||||||
<Button x:Name="uplaodpb" Click="uploadpbclick" Content="Upload" Foreground="White" Background="#FF6332A0" BorderThickness="0" Margin="10,351,574,5" BorderBrush="{x:Null}" Style="{StaticResource NoHoverButtonStyle}" RenderTransformOrigin="0.279,0.633" Grid.Row="1"/>
|
<Button x:Name="uplaodpb" Click="uploadpbclick" Content="Upload" Foreground="White" Background="#FF6332A0" BorderThickness="0" Margin="10,351,574,5" BorderBrush="{x:Null}" Style="{StaticResource NoHoverButtonStyle}" RenderTransformOrigin="0.279,0.633" Grid.Row="1"/>
|
||||||
|
|
||||||
|
|
||||||
|
@@ -4,26 +4,19 @@ using System.Windows;
|
|||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using bib_talk.Business;
|
using bib_talk.Business;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
|
||||||
namespace bib_talk
|
namespace bib_talk
|
||||||
{
|
{
|
||||||
public partial class MainWindow : Window
|
public partial class MainWindow : Window
|
||||||
{
|
{
|
||||||
MainWindowManager mwManager;
|
MainWindowManager mwManager; // MainWindowManager initializeren
|
||||||
|
|
||||||
private DispatcherTimer _timer;
|
private DispatcherTimer _timer; // DispatcherTimer initialisieren
|
||||||
public string loggedinUser;
|
public string loggedinUser; // Feld um eingeloggten User zu speichern
|
||||||
private bool isFirstLoad = true;
|
private bool isFirstLoad = true;
|
||||||
|
|
||||||
public MainWindow()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
InitializeTimer();
|
|
||||||
LoadData();
|
|
||||||
|
|
||||||
mwManager = new MainWindowManager(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// MainWindow Konstruktor mit einem User und LoadMessages Methode
|
||||||
public MainWindow(string user)
|
public MainWindow(string user)
|
||||||
{
|
{
|
||||||
loggedinUser = user;
|
loggedinUser = user;
|
||||||
@@ -36,6 +29,7 @@ namespace bib_talk
|
|||||||
mwManager.LoadMessages();
|
mwManager.LoadMessages();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Der 3 Sekunden Timer für die Nachrichten und Online Benutzer
|
||||||
private void InitializeTimer()
|
private void InitializeTimer()
|
||||||
{
|
{
|
||||||
_timer = new DispatcherTimer
|
_timer = new DispatcherTimer
|
||||||
@@ -45,17 +39,21 @@ namespace bib_talk
|
|||||||
_timer.Tick += (sender, e) => { mwManager.LoadMessages(); mwManager.LoadOnlineUsers(); };
|
_timer.Tick += (sender, e) => { mwManager.LoadMessages(); mwManager.LoadOnlineUsers(); };
|
||||||
_timer.Start();
|
_timer.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode zum Usernamen in dem MainWindow anzeigen
|
||||||
public void LoadData()
|
public void LoadData()
|
||||||
{
|
{
|
||||||
loggedinuser.Text = "Logged in as: " + loggedinUser;
|
loggedInUser.Text = "Logged in as: " + loggedinUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode zum User ausloggen und App schließen
|
||||||
private void CloseButton_Click(object sender, RoutedEventArgs e)
|
private void CloseButton_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
mwManager.LogoutUser();
|
mwManager.LogoutUser();
|
||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Custom DraggableArea für das MainWindow
|
||||||
private void DraggableArea_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
private void DraggableArea_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.ButtonState == MouseButtonState.Pressed)
|
if (e.ButtonState == MouseButtonState.Pressed)
|
||||||
@@ -64,7 +62,8 @@ namespace bib_talk
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void messageBOX_KeyDown(object sender, KeyEventArgs e)
|
// Hotkey (Enter) für das Senden einer Nachricht
|
||||||
|
private async void messageBox_KeyDown(object sender, KeyEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Key == Key.Enter)
|
if (e.Key == Key.Enter)
|
||||||
{
|
{
|
||||||
@@ -72,52 +71,14 @@ namespace bib_talk
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Senden Button für das Senden einer Nachricht
|
||||||
private async void send_Click(object sender, RoutedEventArgs e)
|
private async void send_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
mwManager.SendMessage();
|
mwManager.SendMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ChatFenster_Click(object sender, RoutedEventArgs e)
|
// Methode zum Profilbilder hochladen
|
||||||
{
|
private async void uploadpbclick(object sender, RoutedEventArgs e)
|
||||||
if (popup.IsOpen = true)
|
|
||||||
{
|
|
||||||
popup.Focus();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
popup.IsOpen = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
private void Button1_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
MessageBox.Show("Button 1 wurde geklickt!");
|
|
||||||
ClosePopup();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Button2_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
MessageBox.Show("Button 2 wurde geklickt!");
|
|
||||||
ClosePopup();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Button3_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
MessageBox.Show("Button 3 wurde geklickt!");
|
|
||||||
ClosePopup();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Popup_LostFocus(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
ClosePopup();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ClosePopup()
|
|
||||||
{
|
|
||||||
popup.IsOpen = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void uploadpbclick(object sender, RoutedEventArgs e)
|
|
||||||
{
|
{
|
||||||
OpenFileDialog openFileDialog = new OpenFileDialog();
|
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||||
openFileDialog.Filter = "Image files (*.jpg, *.jpeg, *.png, *.gif) | *.jpg; *.jpeg; *.png; *.gif";
|
openFileDialog.Filter = "Image files (*.jpg, *.jpeg, *.png, *.gif) | *.jpg; *.jpeg; *.png; *.gif";
|
||||||
@@ -127,5 +88,31 @@ namespace bib_talk
|
|||||||
await mwManager.UploadProfileImage(filePath);
|
await mwManager.UploadProfileImage(filePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Logik für den Chat Clear Button
|
||||||
|
private void clearChatButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
//Rufe die Methode zum Löschen des Chats auf
|
||||||
|
mwManager.DeleteMessages();
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Ohne Funktion
|
||||||
|
// Chat Settings Logik
|
||||||
|
private void MenuButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// Öffnen Sie das Kontextmenü, wenn Sie auf den Drei-Punkte-Button klicken
|
||||||
|
contextMenu.IsOpen = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void muteChatButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// Logik zum Blockieren eines Benutzers
|
||||||
|
}
|
||||||
|
|
||||||
|
private void helpButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// Logik zum Entfernen eines Freundes
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -95,9 +95,6 @@
|
|||||||
</DataTrigger>
|
</DataTrigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
<Style TargetType="Hyperlink">
|
|
||||||
<EventSetter Event="RequestNavigate" Handler="Hyperlink_RequestNavigate"/>
|
|
||||||
</Style>
|
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
|
|
||||||
<Border CornerRadius="15" BorderThickness="20" BorderBrush="#FF282828">
|
<Border CornerRadius="15" BorderThickness="20" BorderBrush="#FF282828">
|
||||||
@@ -142,7 +139,7 @@
|
|||||||
Margin="0,30,0,0"
|
Margin="0,30,0,0"
|
||||||
Background="#FF323134"
|
Background="#FF323134"
|
||||||
Foreground="White"
|
Foreground="White"
|
||||||
SelectionBrush="#FF6332A0"/>
|
SelectionBrush="#FF6332A0" KeyDown="emailbox_KeyDown"/>
|
||||||
|
|
||||||
<!-- Benutzername TextBox -->
|
<!-- Benutzername TextBox -->
|
||||||
<TextBlock Text="Benutzername"
|
<TextBlock Text="Benutzername"
|
||||||
@@ -157,7 +154,7 @@
|
|||||||
Margin="0,30,0,0"
|
Margin="0,30,0,0"
|
||||||
Background="#FF323134"
|
Background="#FF323134"
|
||||||
Foreground="White"
|
Foreground="White"
|
||||||
SelectionBrush="#FF6332A0"/>
|
SelectionBrush="#FF6332A0" KeyDown="usernbox_KeyDown"/>
|
||||||
|
|
||||||
<!-- Passwort PasswordBox -->
|
<!-- Passwort PasswordBox -->
|
||||||
<TextBlock Text="Passwort"
|
<TextBlock Text="Passwort"
|
||||||
@@ -172,7 +169,7 @@
|
|||||||
Margin="0,30,0,0"
|
Margin="0,30,0,0"
|
||||||
Background="#FF323134"
|
Background="#FF323134"
|
||||||
Foreground="White"
|
Foreground="White"
|
||||||
SelectionBrush="#FF6332A0"/>
|
SelectionBrush="#FF6332A0" KeyDown="passwordbox_KeyDown"/>
|
||||||
|
|
||||||
<!-- Geburtsdatum Text -->
|
<!-- Geburtsdatum Text -->
|
||||||
<TextBlock Text="Geburtsdatum"
|
<TextBlock Text="Geburtsdatum"
|
||||||
@@ -187,7 +184,7 @@
|
|||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent"
|
||||||
Background="#FF323134"
|
Background="#FF323134"
|
||||||
Foreground="White"
|
Foreground="White"
|
||||||
SelectionBrush="#FF6332A0"/>
|
SelectionBrush="#FF6332A0" KeyDown="bday1_KeyDown"/>
|
||||||
<TextBox Width="100"
|
<TextBox Width="100"
|
||||||
Height="30"
|
Height="30"
|
||||||
FontSize="20"
|
FontSize="20"
|
||||||
@@ -195,7 +192,7 @@
|
|||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent"
|
||||||
Background="#FF323134"
|
Background="#FF323134"
|
||||||
Foreground="White"
|
Foreground="White"
|
||||||
SelectionBrush="#FF6332A0"/>
|
SelectionBrush="#FF6332A0" KeyDown="bday2_KeyDown"/>
|
||||||
<TextBox Width="100"
|
<TextBox Width="100"
|
||||||
Height="30"
|
Height="30"
|
||||||
FontSize="20"
|
FontSize="20"
|
||||||
@@ -208,7 +205,7 @@
|
|||||||
|
|
||||||
<!-- Checkbox -->
|
<!-- Checkbox -->
|
||||||
<Grid Margin="0,20,0,0" Height="30.1" Width="250">
|
<Grid Margin="0,20,0,0" Height="30.1" Width="250">
|
||||||
<CheckBox x:Name="checkboxAGB" Style="{StaticResource CustomCheckBoxStyle}" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked" Margin="-25,0,235,0"/>
|
<CheckBox x:Name="checkboxAGB" Style="{StaticResource CustomCheckBoxStyle}" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked" Margin="-21,0,240,0"/>
|
||||||
<TextBlock FontSize="9" TextWrapping="Wrap" VerticalAlignment="Center" Height="24" Margin="15,0,-28,0">
|
<TextBlock FontSize="9" TextWrapping="Wrap" VerticalAlignment="Center" Height="24" Margin="15,0,-28,0">
|
||||||
<Run Text="Ich habe die " Foreground="White"/>
|
<Run Text="Ich habe die " Foreground="White"/>
|
||||||
<Run x:Name="nutzungsbedingungenRun" Text="Nutzungsbedingungen" Foreground="#FF6332A0"/>
|
<Run x:Name="nutzungsbedingungenRun" Text="Nutzungsbedingungen" Foreground="#FF6332A0"/>
|
||||||
|
@@ -1,7 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Threading;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
@@ -11,26 +13,23 @@ namespace bib_talk
|
|||||||
{
|
{
|
||||||
public partial class RegisterWindow : Window
|
public partial class RegisterWindow : Window
|
||||||
{
|
{
|
||||||
RegisterManager registerManager;
|
RegisterManager registerManager; // RegisterManager Objekt initialisieren
|
||||||
|
|
||||||
|
// Konstruktor für das RegisterWindow
|
||||||
public RegisterWindow()
|
public RegisterWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
registerManager = new RegisterManager(this);
|
registerManager = new RegisterManager(this); // RegisterManager Objekt erstellen
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
|
// Methode für das Schließen des Fensters
|
||||||
{
|
|
||||||
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri) { UseShellExecute = true });
|
|
||||||
e.Handled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CloseButton_Click(object sender, RoutedEventArgs e)
|
private void CloseButton_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode für die Custom Draggable Area
|
||||||
private void DraggableArea_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
private void DraggableArea_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.ButtonState == MouseButtonState.Pressed)
|
if (e.ButtonState == MouseButtonState.Pressed)
|
||||||
@@ -39,6 +38,7 @@ namespace bib_talk
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode um das Login Window aufzurufen
|
||||||
private void Login_Click(object sender, RoutedEventArgs e)
|
private void Login_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Login login = new Login();
|
Login login = new Login();
|
||||||
@@ -46,6 +46,7 @@ namespace bib_talk
|
|||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode um das Registrieren abzuschließen und das Login Window aufzurufen
|
||||||
private async void WeiterButton_Click(object sender, RoutedEventArgs e)
|
private async void WeiterButton_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (checkboxAGB.IsChecked == true)
|
if (checkboxAGB.IsChecked == true)
|
||||||
@@ -66,6 +67,8 @@ namespace bib_talk
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode um den Weiter Button zu aktivieren, wenn die "Nutzungsbedingungen"
|
||||||
|
// akzeptiert wurden
|
||||||
private void CheckBox_Checked(object sender, RoutedEventArgs e)
|
private void CheckBox_Checked(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
SolidColorBrush customBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF6332A0"));
|
SolidColorBrush customBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF6332A0"));
|
||||||
@@ -73,6 +76,8 @@ namespace bib_talk
|
|||||||
weiterbutton.Background = customBrush;
|
weiterbutton.Background = customBrush;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode um den Weiter Button zu deaktivieren, wenn die "Nutzungsbedingungen"
|
||||||
|
// abgelehnt wurden
|
||||||
private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
|
private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
SolidColorBrush customBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF323134"));
|
SolidColorBrush customBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF323134"));
|
||||||
@@ -80,6 +85,7 @@ namespace bib_talk
|
|||||||
weiterbutton.Background = customBrush;
|
weiterbutton.Background = customBrush;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode um die Eingaben des Benutzers zu validieren
|
||||||
private bool ValidateRegistration()
|
private bool ValidateRegistration()
|
||||||
{
|
{
|
||||||
string username = usernbox.Text;
|
string username = usernbox.Text;
|
||||||
@@ -121,6 +127,64 @@ namespace bib_talk
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methode um via den Enter Key zum nächsten Textfeld zu springen
|
||||||
|
private void emailbox_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Key == Key.Enter)
|
||||||
|
{
|
||||||
|
usernbox.Focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Methode um via den Enter Key zum nächsten Textfeld zu springen
|
||||||
|
private void usernbox_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Key == Key.Enter)
|
||||||
|
{
|
||||||
|
passwordbox.Focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Methode um via den Enter Key zum nächsten Textfeld zu springen
|
||||||
|
private void passwordbox_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Key == Key.Enter)
|
||||||
|
{
|
||||||
|
bday1.Focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Methode um via den Enter Key zum nächsten Textfeld zu springen
|
||||||
|
private void bday1_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Key == Key.Enter)
|
||||||
|
{
|
||||||
|
bday2.Focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Methode um via den Enter Key zum nächsten Textfeld zu springen
|
||||||
|
private void bday2_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Key == Key.Enter)
|
||||||
|
{
|
||||||
|
bday3.Focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Benutzt um 100 User accounts zu erstellen
|
||||||
|
//private void RegisterNewBots(object sender, RoutedEventArgs e)
|
||||||
|
//{
|
||||||
|
// for (int i = 10; i <= 100; i++)
|
||||||
|
// {
|
||||||
|
// string name = "Bot";
|
||||||
|
// string password = "Bot123";
|
||||||
|
// string email = "bot@edu.bib.de";
|
||||||
|
// string birthday = "12.12.2000";
|
||||||
|
// registerManager.RegisterBots(name + i, password, i + email, birthday);
|
||||||
|
// Thread.Sleep(1000);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user