Compare commits
49 Commits
e7599c4dde
...
main
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9274f8b609 | ||
![]() |
7926c808af | ||
![]() |
39cda1170e | ||
![]() |
c390dfe5e3 | ||
![]() |
4edc2f2188 | ||
![]() |
fd2ebc5aaa | ||
![]() |
8b71f84284 | ||
![]() |
f9d5053029 | ||
![]() |
d9976ff520 | ||
![]() |
ce490cf68f | ||
![]() |
eb97a29912 | ||
![]() |
96fbb4498d | ||
![]() |
ab0ac8597d | ||
![]() |
8ac2eeabdf | ||
![]() |
c9f38ba451 | ||
![]() |
580a039a0e | ||
![]() |
6f36ecf630 | ||
![]() |
897a0dc848 | ||
![]() |
76695263a1 | ||
![]() |
a05b392aea | ||
![]() |
80f2610b04 | ||
![]() |
28460e3312 | ||
![]() |
891f3f9e87 | ||
![]() |
068ba16156 | ||
![]() |
fe3e428f31 | ||
![]() |
dd92942809 | ||
![]() |
313bb6d990 | ||
![]() |
3feff69b9e | ||
![]() |
1dad331471 | ||
![]() |
f2b84ec28e | ||
![]() |
cbb33c6cac | ||
![]() |
e6c971bf15 | ||
![]() |
ef01b50e53 | ||
![]() |
7b8355972b | ||
![]() |
4f849171c9 | ||
![]() |
b1afac887b | ||
![]() |
1fcb3fb058 | ||
![]() |
5197504128 | ||
![]() |
696e4eeb03 | ||
![]() |
5aa0055815 | ||
![]() |
c3ca4ec25d | ||
![]() |
2a497ec081 | ||
![]() |
3d23c510d6 | ||
![]() |
892d19a91f | ||
![]() |
b44876f63c | ||
![]() |
d1602c5cc6 | ||
![]() |
d9293ba4aa | ||
![]() |
0bf918fc34 | ||
![]() |
09329510c1 |
BIN
Bib_Talk_Entwurfsdokumentation.pdf
Normal file
BIN
Bilder/Farbpalette.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
Bilder/PICA.jpg
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
Projekt Dokumentation.pdf
Normal file
BIN
Testdokumentation bib-Talk.pdf
Normal file
63
bibtalk/.gitattributes
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
###############################################################################
|
||||
# Set default behavior to automatically normalize line endings.
|
||||
###############################################################################
|
||||
* text=auto
|
||||
|
||||
###############################################################################
|
||||
# Set default behavior for command prompt diff.
|
||||
#
|
||||
# This is need for earlier builds of msysgit that does not have it on by
|
||||
# default for csharp files.
|
||||
# Note: This is only used by command line
|
||||
###############################################################################
|
||||
#*.cs diff=csharp
|
||||
|
||||
###############################################################################
|
||||
# Set the merge driver for project and solution files
|
||||
#
|
||||
# Merging from the command prompt will add diff markers to the files if there
|
||||
# are conflicts (Merging from VS is not affected by the settings below, in VS
|
||||
# the diff markers are never inserted). Diff markers may cause the following
|
||||
# file extensions to fail to load in VS. An alternative would be to treat
|
||||
# these files as binary and thus will always conflict and require user
|
||||
# intervention with every merge. To do so, just uncomment the entries below
|
||||
###############################################################################
|
||||
#*.sln merge=binary
|
||||
#*.csproj merge=binary
|
||||
#*.vbproj merge=binary
|
||||
#*.vcxproj merge=binary
|
||||
#*.vcproj merge=binary
|
||||
#*.dbproj merge=binary
|
||||
#*.fsproj merge=binary
|
||||
#*.lsproj merge=binary
|
||||
#*.wixproj merge=binary
|
||||
#*.modelproj merge=binary
|
||||
#*.sqlproj merge=binary
|
||||
#*.wwaproj merge=binary
|
||||
|
||||
###############################################################################
|
||||
# behavior for image files
|
||||
#
|
||||
# image files are treated as binary by default.
|
||||
###############################################################################
|
||||
#*.jpg binary
|
||||
#*.png binary
|
||||
#*.gif binary
|
||||
|
||||
###############################################################################
|
||||
# diff behavior for common document formats
|
||||
#
|
||||
# Convert binary document formats to text before diffing them. This feature
|
||||
# is only available from the command line. Turn it on by uncommenting the
|
||||
# entries below.
|
||||
###############################################################################
|
||||
#*.doc diff=astextplain
|
||||
#*.DOC diff=astextplain
|
||||
#*.docx diff=astextplain
|
||||
#*.DOCX diff=astextplain
|
||||
#*.dot diff=astextplain
|
||||
#*.DOT diff=astextplain
|
||||
#*.pdf diff=astextplain
|
||||
#*.PDF diff=astextplain
|
||||
#*.rtf diff=astextplain
|
||||
#*.RTF diff=astextplain
|
363
bibtalk/.gitignore
vendored
Normal file
@@ -0,0 +1,363 @@
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||
|
||||
# User-specific files
|
||||
*.rsuser
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Mono auto generated files
|
||||
mono_crash.*
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
[Ww][Ii][Nn]32/
|
||||
[Aa][Rr][Mm]/
|
||||
[Aa][Rr][Mm]64/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Oo]ut/
|
||||
[Ll]og/
|
||||
[Ll]ogs/
|
||||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUnit
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
nunit-*.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# Benchmark Results
|
||||
BenchmarkDotNet.Artifacts/
|
||||
|
||||
# .NET Core
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
# ASP.NET Scaffolding
|
||||
ScaffoldingReadMe.txt
|
||||
|
||||
# StyleCop
|
||||
StyleCopReport.xml
|
||||
|
||||
# Files built by Visual Studio
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_h.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.iobj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.ipdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*_wpftmp.csproj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# Visual Studio Trace Files
|
||||
*.e2e
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# AxoCover is a Code Coverage Tool
|
||||
.axoCover/*
|
||||
!.axoCover/settings.json
|
||||
|
||||
# Coverlet is a free, cross platform Code Coverage Tool
|
||||
coverage*.json
|
||||
coverage*.xml
|
||||
coverage*.info
|
||||
|
||||
# Visual Studio code coverage results
|
||||
*.coverage
|
||||
*.coveragexml
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# NuGet Symbol Packages
|
||||
*.snupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/[Pp]ackages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/[Pp]ackages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/[Pp]ackages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignorable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
*.appx
|
||||
*.appxbundle
|
||||
*.appxupload
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!?*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
orleans.codegen.cs
|
||||
|
||||
# Including strong name files can present a security risk
|
||||
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||
#*.snk
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
ServiceFabricBackup/
|
||||
*.rptproj.bak
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
*.ndf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
*.rptproj.rsuser
|
||||
*- [Bb]ackup.rdl
|
||||
*- [Bb]ackup ([0-9]).rdl
|
||||
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
node_modules/
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||
*.vbw
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# CodeRush personal settings
|
||||
.cr/personal
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
# tools/**
|
||||
# !tools/packages.config
|
||||
|
||||
# Tabs Studio
|
||||
*.tss
|
||||
|
||||
# Telerik's JustMock configuration file
|
||||
*.jmconfig
|
||||
|
||||
# BizTalk build output
|
||||
*.btp.cs
|
||||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
||||
|
||||
# OpenCover UI analysis results
|
||||
OpenCover/
|
||||
|
||||
# Azure Stream Analytics local run output
|
||||
ASALocalRun/
|
||||
|
||||
# MSBuild Binary and Structured Log
|
||||
*.binlog
|
||||
|
||||
# NVidia Nsight GPU debugger configuration file
|
||||
*.nvuser
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
|
||||
# Local History for Visual Studio
|
||||
.localhistory/
|
||||
|
||||
# BeatPulse healthcheck temp database
|
||||
healthchecksdb
|
||||
|
||||
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||
MigrationBackup/
|
||||
|
||||
# Ionide (cross platform F# VS Code tools) working folder
|
||||
.ionide/
|
||||
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
BIN
bibtalk/Pics/Logo_bib-Talk.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
bibtalk/Pics/PICA.jpg
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
bibtalk/Pics/logo.png
Normal file
After Width: | Height: | Size: 26 KiB |
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -0,0 +1 @@
|
||||
global using Microsoft.VisualStudio.TestTools.UnitTesting;
|
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
@@ -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
1
bibtalk/UserTests/GlobalUsings.cs
Normal file
@@ -0,0 +1 @@
|
||||
global using Microsoft.VisualStudio.TestTools.UnitTesting;
|
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
@@ -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>
|
25
bibtalk/bib-talk.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.4.33213.308
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "bib-talk", "bib-talk\bib-talk.csproj", "{92B3214E-6FB1-4D94-B93F-6F1A9D9F2224}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{92B3214E-6FB1-4D94-B93F-6F1A9D9F2224}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{92B3214E-6FB1-4D94-B93F-6F1A9D9F2224}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{92B3214E-6FB1-4D94-B93F-6F1A9D9F2224}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{92B3214E-6FB1-4D94-B93F-6F1A9D9F2224}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {B10C1A50-9612-42F2-9E3A-75F0E9739D01}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
9
bibtalk/bib-talk/App.xaml
Normal file
@@ -0,0 +1,9 @@
|
||||
<Application x:Class="bib_talk.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:bib_talk"
|
||||
StartupUri="UI/Login.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
17
bibtalk/bib-talk/App.xaml.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace bib_talk
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
10
bibtalk/bib-talk/AssemblyInfo.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.Windows;
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
52
bibtalk/bib-talk/Business/LoginManager.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
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
|
||||
{
|
||||
public class LoginManager
|
||||
{
|
||||
private LoginDatabase loginDatabase; // LoginDatabase Objekt initialisieren
|
||||
|
||||
// Konstruktor für den LoginManager
|
||||
public LoginManager(Login loginWindow)
|
||||
{
|
||||
loginDatabase = new LoginDatabase(loginWindow); // LoginDatabase Objekt deklarieren
|
||||
}
|
||||
|
||||
// Methode zum User einloggen via LoginDatabase
|
||||
public async void Login()
|
||||
{
|
||||
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}");
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
54
bibtalk/bib-talk/Business/MainWindowManager.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System.Threading.Tasks;
|
||||
using bib_talk.Repository;
|
||||
|
||||
namespace bib_talk.Business
|
||||
{
|
||||
public class MainWindowManager
|
||||
{
|
||||
private MainWindowDatabase mwDatabase; //MainWindowDatabase initializeren
|
||||
private string loggedInUser; // Feld um eingeloggten User zu speichern
|
||||
|
||||
// Konstruktor für MainWindowManager mit MainWindow und User Referenz
|
||||
public MainWindowManager(MainWindow mainWindow, string user)
|
||||
{
|
||||
mwDatabase = new MainWindowDatabase(mainWindow, user);
|
||||
loggedInUser = user;
|
||||
}
|
||||
|
||||
// Methode zum Senden einer Nachricht via Datenbankmanager
|
||||
public void SendMessage()
|
||||
{
|
||||
mwDatabase.SendMessage();
|
||||
}
|
||||
|
||||
// Methode zum Laden der Nachrichten via Datenbankmanager
|
||||
public void LoadMessages()
|
||||
{
|
||||
mwDatabase.LoadMessages();
|
||||
}
|
||||
|
||||
// Methode zum Laden der Online Benutzer via Datenbankmanager
|
||||
public void LoadOnlineUsers()
|
||||
{
|
||||
mwDatabase.LoadOnlineUsers();
|
||||
}
|
||||
|
||||
// Methode zum Ausloggen des Users via Datenbankmanager
|
||||
public void LogoutUser()
|
||||
{
|
||||
mwDatabase.LogoutUser();
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
13
bibtalk/bib-talk/Business/Message.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace bib_talk.Business
|
||||
{
|
||||
// Klasse um die Nachrichten in der Datenbank zu speichern
|
||||
public class Message
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Username { get; set; }
|
||||
public string Text { get; set; }
|
||||
public DateTime Timestamp { get; set; }
|
||||
}
|
||||
}
|
12
bibtalk/bib-talk/Business/MessageDto.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace bib_talk.Business
|
||||
{
|
||||
// Klasse damit die Nachrichten in der App benutzt werden können
|
||||
public class MessageDto
|
||||
{
|
||||
public string Username { get; set; }
|
||||
public string Message { get; set; }
|
||||
public DateTime Timestamp { get; set; }
|
||||
}
|
||||
}
|
49
bibtalk/bib-talk/Business/RegisterManager.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using bib_talk.Repository;
|
||||
using Newtonsoft.Json;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
|
||||
namespace bib_talk.Business
|
||||
{
|
||||
public class RegisterManager
|
||||
{
|
||||
private RegisterDatabase registerDatabase; // RegisterDatabase Objekt initialisieren
|
||||
|
||||
// Konstruktor für den RegisterManager
|
||||
public RegisterManager(RegisterWindow registerWindow)
|
||||
{
|
||||
registerDatabase = new RegisterDatabase(registerWindow); // RegisterDatabase Objekt deklarieren
|
||||
}
|
||||
|
||||
// Methode um einen neuen Nutzer zu Registrieren via der RegisterDatabase
|
||||
public async void 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
16
bibtalk/bib-talk/Business/User.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
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 int Id { get; set; }
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string Birthday { get; set; }
|
||||
public string IsOnline { get; set; }
|
||||
public string ProfileImagePath { get; set; }
|
||||
}
|
||||
}
|
BIN
bibtalk/bib-talk/Icons/Logo_bib-Talk.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
bibtalk/bib-talk/Icons/PICA.jpg
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
bibtalk/bib-talk/Icons/Settings.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
bibtalk/bib-talk/Icons/logo - Copy.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
bibtalk/bib-talk/Icons/logo.png
Normal file
After Width: | Height: | Size: 26 KiB |
49
bibtalk/bib-talk/Repository/LoginDatabase.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace bib_talk.Repository
|
||||
{
|
||||
public class LoginDatabase
|
||||
{
|
||||
Login loginWindow; // Login Window initialisieren
|
||||
|
||||
// Konstruker der LoginDatabase
|
||||
public LoginDatabase(Login loginWindow)
|
||||
{
|
||||
this.loginWindow = loginWindow; // Login Window deklarieren
|
||||
}
|
||||
|
||||
// Methode um den User einzuloggen via eines Server aufrufs
|
||||
public async Task LoginServer()
|
||||
{
|
||||
string username = loginWindow.usernbox.Text;
|
||||
string password = loginWindow.passwordbox.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);
|
||||
string loggedInUsername = responseData.username;
|
||||
MainWindow mainWindow = new MainWindow(loggedInUsername);
|
||||
mainWindow.Show();
|
||||
loginWindow.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
var responseContent = await response.Content.ReadAsStringAsync();
|
||||
MessageBox.Show($"Login failed: {responseContent}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
153
bibtalk/bib-talk/Repository/MainWindowDatabase.cs
Normal file
@@ -0,0 +1,153 @@
|
||||
using bib_talk.Business;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace bib_talk.Repository
|
||||
{
|
||||
public class MainWindowDatabase
|
||||
{
|
||||
private MainWindow mainWindow; // MainWindow initialisieren
|
||||
private string loggedinUser; // Feld um eingeloggten User zu speichern
|
||||
|
||||
// Konstruktor für MainWindowDatabase mit MainWindow und User Referenz
|
||||
public MainWindowDatabase(MainWindow mainWindow, string user)
|
||||
{
|
||||
this.mainWindow = mainWindow;
|
||||
loggedinUser = user;
|
||||
}
|
||||
|
||||
// Methode zum Senden einer Nachricht via Datenbank
|
||||
public async void SendMessage()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(mainWindow.messageBox.Text))
|
||||
{
|
||||
var message = new MessageDto
|
||||
{
|
||||
Username = mainWindow.loggedinUser,
|
||||
Message = mainWindow.messageBox.Text,
|
||||
Timestamp = DateTime.Now,
|
||||
};
|
||||
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var json = JsonConvert.SerializeObject(message);
|
||||
var content = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
var response = await client.PostAsync("http://daddypig.dns.navy:5114/api/messages/send", content);
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
mainWindow.messageBox.Clear();
|
||||
LoadMessages(); // Reload messages after sending
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Methode zum Laden der Nachrichten via Datenbank
|
||||
public async void LoadMessages()
|
||||
{
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var response = await client.GetAsync("http://daddypig.dns.navy:5114/api/messages/get");
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
var responseContent = await response.Content.ReadAsStringAsync();
|
||||
var messages = JsonConvert.DeserializeObject<List<Message>>(responseContent);
|
||||
mainWindow.chatlistbox.ItemsSource = messages;
|
||||
if (mainWindow.chatlistbox.Items.Count > 0)
|
||||
{
|
||||
var lastItem = mainWindow.chatlistbox.Items[mainWindow.chatlistbox.Items.Count - 1];
|
||||
mainWindow.chatlistbox.ScrollIntoView(lastItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Methode zum Laden der Online Benutzer via Datenbank
|
||||
public async void LoadOnlineUsers()
|
||||
{
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var response = await client.GetAsync("http://daddypig.dns.navy:5114/api/users/online-users");
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
var responseContent = await response.Content.ReadAsStringAsync();
|
||||
|
||||
var onlineUsers = JsonConvert.DeserializeObject<List<User>>(responseContent);
|
||||
|
||||
|
||||
mainWindow.onlineUsersListBox.ItemsSource = onlineUsers;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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()
|
||||
{
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var logoutData = new { Username = mainWindow.loggedinUser, Password = "", Email = "", Birthday = "", IsOnline = "" };
|
||||
var json = JsonConvert.SerializeObject(logoutData);
|
||||
var content = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
|
||||
var response = await client.PostAsync("http://daddypig.dns.navy:5114/api/users/logout", content);
|
||||
|
||||
var responseContent = await response.Content.ReadAsStringAsync();
|
||||
|
||||
mainWindow.Close();
|
||||
}
|
||||
}
|
||||
|
||||
// Methode zum Hochladen eines Profilbildes via Datenbank
|
||||
public async Task UploadProfileImage(string filePath)
|
||||
{
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var form = new MultipartFormDataContent();
|
||||
var stream = File.OpenRead(filePath);
|
||||
form.Add(new StreamContent(stream), "file", Path.GetFileName(filePath));
|
||||
|
||||
var response = await client.PostAsync($"http://daddypig.dns.navy:5114/api/users/upload-profile-image?username={loggedinUser}", form);
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
MessageBox.Show("Profilbild erfolgreich hochgeladen");
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Fehler beim Hochladen des Profilbilds");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
46
bibtalk/bib-talk/Repository/RegisterDatabase.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace bib_talk.Repository
|
||||
{
|
||||
public class RegisterDatabase
|
||||
{
|
||||
RegisterWindow registerWindow; // RegisterWindow initailisieren
|
||||
|
||||
// Konstruktor für die RegisterDatabase
|
||||
public RegisterDatabase(RegisterWindow registerWindow)
|
||||
{
|
||||
this.registerWindow = registerWindow;
|
||||
}
|
||||
|
||||
// Methode um einen Nutzer zu registrieren und die Daten
|
||||
// in die Datenbank zu schreiben
|
||||
public async Task RegisterServer()
|
||||
{
|
||||
string username = registerWindow.usernbox.Text;
|
||||
string password = registerWindow.passwordbox.Password;
|
||||
string email = registerWindow.emailbox.Text;
|
||||
string birthday = $"{registerWindow.bday1.Text}.{registerWindow.bday2.Text}.{registerWindow.bday3.Text}";
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
139
bibtalk/bib-talk/UI/Login.xaml
Normal file
@@ -0,0 +1,139 @@
|
||||
<Window x:Class="bib_talk.Login"
|
||||
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="Login"
|
||||
Height="380"
|
||||
Width="600"
|
||||
WindowStyle="None"
|
||||
AllowsTransparency="True"
|
||||
Background="Transparent"
|
||||
WindowStartupLocation="CenterScreen">
|
||||
<Window.Resources>
|
||||
<Style x:Key="InvisibleButtonStyle" TargetType="Button">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="OverridesDefaultStyle" Value="True"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<Style x:Key="NoHoverButtonStyle" TargetType="Button">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="HoverUnderlineTextBlockStyle" TargetType="TextBlock">
|
||||
<Setter Property="TextDecorations" Value="None"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource AncestorType=Button}}" Value="True">
|
||||
<Setter Property="TextDecorations" Value="Underline"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
|
||||
<Border CornerRadius="15" BorderThickness="20" BorderBrush="#FF282828">
|
||||
<Grid Margin="-10,-10,-10,-10" Background="#FF282828">
|
||||
<!-- Draggable Area -->
|
||||
<Image HorizontalAlignment="Left" Height="450" Margin="237,-162,0,0" VerticalAlignment="Top" Width="591" Source="/Icons/logo.png"/>
|
||||
|
||||
<Grid VerticalAlignment="Top" Height="45" Background="Transparent" MouseLeftButtonDown="DraggableArea_MouseLeftButtonDown" Margin="0,-21,0,0">
|
||||
|
||||
</Grid>
|
||||
<!-- Close Button -->
|
||||
<Button Style="{StaticResource InvisibleButtonStyle}"
|
||||
Width="30"
|
||||
Height="30"
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,0,0"
|
||||
Click="CloseButton_Click">
|
||||
<TextBlock Text="❌"
|
||||
FontSize="20"
|
||||
Foreground="White"
|
||||
FontWeight="Bold"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</Button>
|
||||
<StackPanel VerticalAlignment="Top" HorizontalAlignment="Left" Margin="23,29,0,0" Height="324">
|
||||
<TextBlock Text="Willkommen zurück!"
|
||||
FontSize="24"
|
||||
Foreground="White"
|
||||
HorizontalAlignment="Center"/>
|
||||
|
||||
<!-- Email TextBox -->
|
||||
<TextBlock Text="Benutzername"
|
||||
Foreground="White"
|
||||
FontSize="16"
|
||||
Margin="0,40,0,-30"/>
|
||||
<TextBox Width="300"
|
||||
x:Name="usernbox"
|
||||
Height="30"
|
||||
FontSize="20"
|
||||
BorderBrush="Transparent"
|
||||
Margin="0,30,0,0"
|
||||
Background="#FF323134"
|
||||
Foreground="White"
|
||||
SelectionBrush="#FF6332A0" KeyDown="userNameBox_KeyDown"/>
|
||||
|
||||
<!-- Benutzername TextBox -->
|
||||
<TextBlock Text="Passwort"
|
||||
Foreground="White"
|
||||
FontSize="16"
|
||||
Margin="0,20,0,-30"/>
|
||||
<PasswordBox Width="300"
|
||||
x:Name="passwordbox"
|
||||
PasswordChanged="passwordbox_PasswordChanged"
|
||||
Height="30"
|
||||
FontSize="20"
|
||||
BorderBrush="Transparent"
|
||||
Margin="0,30,0,0"
|
||||
Background="#FF323134"
|
||||
Foreground="White"
|
||||
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}"/>
|
||||
<TextBlock Text="Noch keinen Account?"
|
||||
Foreground="White"
|
||||
FontSize="12"
|
||||
Width="136"
|
||||
Margin="20,20,0,0"/>
|
||||
<Button x:Name="RegisterButton" Style="{StaticResource InvisibleButtonStyle}" Click="Register_Click">
|
||||
<TextBlock x:Name="RegisterTextBlock" Text="Registrieren"
|
||||
Foreground="#FF6332A0"
|
||||
FontSize="12"
|
||||
Width="66"
|
||||
Margin="8,5,0,0"
|
||||
Style="{StaticResource HoverUnderlineTextBlockStyle}"/>
|
||||
</Button>
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Window>
|
110
bibtalk/bib-talk/UI/Login.xaml.cs
Normal file
@@ -0,0 +1,110 @@
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows;
|
||||
using bib_talk.Business;
|
||||
using System.Windows.Controls;
|
||||
using System.Threading;
|
||||
|
||||
namespace bib_talk
|
||||
{
|
||||
public partial class Login : Window
|
||||
{
|
||||
LoginManager loginManager;
|
||||
|
||||
public static string loggedInUser; // Feld um eingeloggten User zu speichern
|
||||
|
||||
// Konstruktor für das Login Fenster
|
||||
public Login()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
loginManager = new LoginManager(this);
|
||||
}
|
||||
|
||||
// Methode für Custom Draggable Area
|
||||
private void DraggableArea_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.ButtonState == MouseButtonState.Pressed)
|
||||
{
|
||||
DragMove();
|
||||
}
|
||||
}
|
||||
|
||||
// Methode um das Fenster zu schließen
|
||||
private void CloseButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
// Methode um den User einzuloggen
|
||||
private async void WeiterButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (usernbox.Text != "" && passwordbox.Password != "")
|
||||
{
|
||||
loginManager.Login();
|
||||
}
|
||||
}
|
||||
|
||||
// Methode um den Weiter Button zu Aktivieren, wenn ein Nutzername und Passwort eingegeben ist
|
||||
private void passwordbox_PasswordChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (usernbox.Text != "" && passwordbox.Password != "")
|
||||
{
|
||||
SolidColorBrush customBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF6332A0"));
|
||||
weiterbutton.Foreground = Brushes.White;
|
||||
weiterbutton.Background = customBrush;
|
||||
}
|
||||
else
|
||||
{
|
||||
SolidColorBrush customBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF323134"));
|
||||
weiterbutton.Foreground = Brushes.Gray;
|
||||
weiterbutton.Background = customBrush;
|
||||
}
|
||||
}
|
||||
|
||||
// Methode um das Registrierungs Fenster zu öffnen
|
||||
private void Register_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
RegisterWindow register = new RegisterWindow();
|
||||
register.Show();
|
||||
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);
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
179
bibtalk/bib-talk/UI/MainWindow.xaml
Normal file
@@ -0,0 +1,179 @@
|
||||
<Window x:Class="bib_talk.MainWindow"
|
||||
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="MainWindow"
|
||||
Height="700"
|
||||
Width="1000"
|
||||
WindowStyle="None"
|
||||
AllowsTransparency="True"
|
||||
Background="Transparent"
|
||||
WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
|
||||
<Window.Resources>
|
||||
|
||||
|
||||
<Style x:Key="InvisibleButtonStyle" TargetType="Button">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="OverridesDefaultStyle" Value="True"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<Style x:Key="NoHoverButtonStyle" TargetType="Button">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
|
||||
<Border CornerRadius="15" BorderThickness="20" BorderBrush="#FF282828">
|
||||
<Grid Margin="-10,-10,-10,-10" Background="#FF282828">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="289*"/>
|
||||
<RowDefinition Height="392*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="632*"/>
|
||||
<ColumnDefinition Width="115*"/>
|
||||
<ColumnDefinition Width="118*"/>
|
||||
<ColumnDefinition Width="115*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!-- Draggable Area -->
|
||||
<Grid VerticalAlignment="Top" Height="45" Background="Transparent" MouseLeftButtonDown="DraggableArea_MouseLeftButtonDown" Margin="0,-21,0,0" Grid.ColumnSpan="4">
|
||||
|
||||
</Grid>
|
||||
|
||||
<!-- Close Button -->
|
||||
<Button Style="{StaticResource InvisibleButtonStyle}"
|
||||
Width="21"
|
||||
Height="22"
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="Right"
|
||||
Click="CloseButton_Click" Grid.Column="3" RenderTransformOrigin="0.057,0.564" Margin="0,-5,0,0">
|
||||
<TextBlock Text="❌"
|
||||
FontSize="15"
|
||||
Foreground="White"
|
||||
FontWeight="Bold"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"/>
|
||||
</Button>
|
||||
<Grid Margin="298,17,0,176" Grid.ColumnSpan="4">
|
||||
<Rectangle Stroke="#FF6332A0" Fill="#FF6332A0" Width="682"/>
|
||||
<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>
|
||||
<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">
|
||||
<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">
|
||||
|
||||
<Rectangle Stroke="#FF282828" Fill="#FF282828"/>
|
||||
<TextBlock Text="Chats" Foreground="White" FontSize="22" Margin="10,18,134,39" />
|
||||
<TextBox
|
||||
FontSize="20"
|
||||
BorderBrush="Transparent"
|
||||
Margin="10,61,10,10"
|
||||
Background="#FF6332A0"
|
||||
Foreground="White"
|
||||
SelectionBrush="#FF6332A0" RenderTransformOrigin="0.5,0.5">
|
||||
<TextBox.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform ScaleX="-1" ScaleY="-1"/>
|
||||
<SkewTransform/>
|
||||
<RotateTransform Angle="-180"/>
|
||||
<TranslateTransform/>
|
||||
</TransformGroup>
|
||||
</TextBox.RenderTransform>
|
||||
</TextBox>
|
||||
</Grid>
|
||||
<Grid Margin="0,17,561,0" Grid.RowSpan="2">
|
||||
<Rectangle Stroke="#FF323134" Fill="#FF323134"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
<ListBox x:Name="onlineUsersListBox" Margin="76,112,339,0" d:ItemsSource="{d:SampleData ItemCount=5}" Background="#FF323134" BorderBrush="{x:Null}" ScrollViewer.HorizontalScrollBarVisibility="Hidden" Grid.RowSpan="2">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal" Width="205" Height="60">
|
||||
<Ellipse Width="10" Height="10" Fill="Green" Margin="5"/>
|
||||
<Image Source="{Binding ProfileImagePath}" Width="50" Height="50" Stretch="Fill">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="25,25" RadiusX="25" RadiusY="25"/>
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Text="{Binding Username}" FontWeight="Bold" Foreground="#FF6332A0" RenderTransformOrigin="0.51,0.532" FontSize="18" Width="123" Height="30" Margin="10,0,0,0"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</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"/>
|
||||
<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>
|
||||
<DataTemplate>
|
||||
<StackPanel Margin="5">
|
||||
<TextBlock Text="{Binding Username}" FontWeight="Bold" FontSize="20"/>
|
||||
<TextBlock Text="{Binding Timestamp, StringFormat='{}{0:yyyy-MM-dd HH:mm:ss}'}" Foreground="Gray"/>
|
||||
<TextBlock TextWrapping="Wrap" Text="{Binding Text}" FontSize="16" Foreground="White"/>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
</DataTemplate>
|
||||
|
||||
</ListBox.ItemTemplate>
|
||||
|
||||
</ListBox>
|
||||
|
||||
<TextBox
|
||||
x:Name="messageBox"
|
||||
FontSize="20"
|
||||
BorderBrush="Transparent"
|
||||
Margin="298,346,76,0"
|
||||
Background="#FF323134"
|
||||
Foreground="White"
|
||||
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,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"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</Window>
|
118
bibtalk/bib-talk/UI/MainWindow.xaml.cs
Normal file
@@ -0,0 +1,118 @@
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Threading;
|
||||
using bib_talk.Business;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace bib_talk
|
||||
{
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
MainWindowManager mwManager; // MainWindowManager initializeren
|
||||
|
||||
private DispatcherTimer _timer; // DispatcherTimer initialisieren
|
||||
public string loggedinUser; // Feld um eingeloggten User zu speichern
|
||||
private bool isFirstLoad = true;
|
||||
|
||||
// MainWindow Konstruktor mit einem User und LoadMessages Methode
|
||||
public MainWindow(string user)
|
||||
{
|
||||
loggedinUser = user;
|
||||
InitializeComponent();
|
||||
InitializeTimer();
|
||||
LoadData();
|
||||
|
||||
mwManager = new MainWindowManager(this, user);
|
||||
|
||||
mwManager.LoadMessages();
|
||||
}
|
||||
|
||||
// Der 3 Sekunden Timer für die Nachrichten und Online Benutzer
|
||||
private void InitializeTimer()
|
||||
{
|
||||
_timer = new DispatcherTimer
|
||||
{
|
||||
Interval = TimeSpan.FromSeconds(2)
|
||||
};
|
||||
_timer.Tick += (sender, e) => { mwManager.LoadMessages(); mwManager.LoadOnlineUsers(); };
|
||||
_timer.Start();
|
||||
}
|
||||
|
||||
// Methode zum Usernamen in dem MainWindow anzeigen
|
||||
public void LoadData()
|
||||
{
|
||||
loggedInUser.Text = "Logged in as: " + loggedinUser;
|
||||
}
|
||||
|
||||
// Methode zum User ausloggen und App schließen
|
||||
private void CloseButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
mwManager.LogoutUser();
|
||||
this.Close();
|
||||
}
|
||||
|
||||
// Custom DraggableArea für das MainWindow
|
||||
private void DraggableArea_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.ButtonState == MouseButtonState.Pressed)
|
||||
{
|
||||
DragMove();
|
||||
}
|
||||
}
|
||||
|
||||
// Hotkey (Enter) für das Senden einer Nachricht
|
||||
private async void messageBox_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Enter)
|
||||
{
|
||||
mwManager.SendMessage();
|
||||
}
|
||||
}
|
||||
|
||||
// Senden Button für das Senden einer Nachricht
|
||||
private async void send_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
mwManager.SendMessage();
|
||||
}
|
||||
|
||||
// Methode zum Profilbilder hochladen
|
||||
private async void uploadpbclick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||
openFileDialog.Filter = "Image files (*.jpg, *.jpeg, *.png, *.gif) | *.jpg; *.jpeg; *.png; *.gif";
|
||||
if (openFileDialog.ShowDialog() == true)
|
||||
{
|
||||
string filePath = openFileDialog.FileName;
|
||||
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
|
||||
}
|
||||
}
|
231
bibtalk/bib-talk/UI/RegisterWindow.xaml
Normal file
@@ -0,0 +1,231 @@
|
||||
<Window x:Class="bib_talk.RegisterWindow"
|
||||
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="Register"
|
||||
Height="530"
|
||||
Width="400"
|
||||
WindowStyle="None"
|
||||
AllowsTransparency="True"
|
||||
Background="Transparent"
|
||||
WindowStartupLocation="CenterScreen">
|
||||
|
||||
<Window.Resources>
|
||||
<Style x:Key="InvisibleButtonStyle" TargetType="Button">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="OverridesDefaultStyle" Value="True"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<Style x:Key="CustomCheckBoxStyle" TargetType="CheckBox">
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="CheckBox">
|
||||
<Grid>
|
||||
<Ellipse x:Name="OuterEllipse"
|
||||
Width="20"
|
||||
Height="20"
|
||||
Fill="#FF323134"
|
||||
Margin="0,0,10,0"
|
||||
|
||||
StrokeThickness="1"/>
|
||||
<Ellipse x:Name="InnerEllipse"
|
||||
Width="14"
|
||||
Height="14"
|
||||
Fill="#FF323134"
|
||||
StrokeThickness="0"
|
||||
Margin="3,8,13,7"/>
|
||||
<Path x:Name="CheckMark"
|
||||
Stroke="#FF6332A0"
|
||||
StrokeThickness="2"
|
||||
Data="M 3,8 L 7,12 L 14,5"
|
||||
Visibility="Visible" Stretch="Fill" Margin="3,10,13,9" RenderTransformOrigin="0.967,1.39"/>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter TargetName="CheckMark" Property="Visibility" Value="Visible"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="False">
|
||||
<Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="NoHoverButtonStyle" TargetType="Button">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="HoverUnderlineTextBlockStyle" TargetType="TextBlock">
|
||||
<Setter Property="TextDecorations" Value="None"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource AncestorType=Button}}" Value="True">
|
||||
<Setter Property="TextDecorations" Value="Underline"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
|
||||
<Border CornerRadius="15" BorderThickness="20" BorderBrush="#FF282828">
|
||||
<Grid Margin="-10,-10,-10,-10" Background="#FF282828">
|
||||
<!-- Draggable Area -->
|
||||
<Grid VerticalAlignment="Top" Height="40" Background="Transparent" MouseLeftButtonDown="DraggableArea_MouseLeftButtonDown">
|
||||
|
||||
</Grid>
|
||||
<!-- Close Button -->
|
||||
<Button Style="{StaticResource InvisibleButtonStyle}"
|
||||
Width="30"
|
||||
Height="30"
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,0,0"
|
||||
Click="CloseButton_Click">
|
||||
<TextBlock Text="❌"
|
||||
FontSize="20"
|
||||
Foreground="White"
|
||||
FontWeight="Bold"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</Button>
|
||||
<!-- Centered Content -->
|
||||
<StackPanel VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,40,0,0" Height="473">
|
||||
<!-- Account erstellen Text -->
|
||||
<TextBlock Text="Account erstellen"
|
||||
FontSize="24"
|
||||
Foreground="White"
|
||||
HorizontalAlignment="Center"/>
|
||||
|
||||
<!-- Email TextBox -->
|
||||
<TextBlock Text="E-Mail"
|
||||
Foreground="White"
|
||||
FontSize="16"
|
||||
Margin="0,40,0,-30"/>
|
||||
<TextBox Width="300"
|
||||
Height="30"
|
||||
FontSize="20"
|
||||
x:Name="emailbox"
|
||||
BorderBrush="Transparent"
|
||||
Margin="0,30,0,0"
|
||||
Background="#FF323134"
|
||||
Foreground="White"
|
||||
SelectionBrush="#FF6332A0" KeyDown="emailbox_KeyDown"/>
|
||||
|
||||
<!-- Benutzername TextBox -->
|
||||
<TextBlock Text="Benutzername"
|
||||
Foreground="White"
|
||||
FontSize="16"
|
||||
Margin="0,20,0,-30"/>
|
||||
<TextBox Width="300"
|
||||
Height="30"
|
||||
FontSize="20"
|
||||
x:Name="usernbox"
|
||||
BorderBrush="Transparent"
|
||||
Margin="0,30,0,0"
|
||||
Background="#FF323134"
|
||||
Foreground="White"
|
||||
SelectionBrush="#FF6332A0" KeyDown="usernbox_KeyDown"/>
|
||||
|
||||
<!-- Passwort PasswordBox -->
|
||||
<TextBlock Text="Passwort"
|
||||
FontSize="16"
|
||||
Foreground="White"
|
||||
Margin="0,20,0,-30"/>
|
||||
<PasswordBox Width="300"
|
||||
Height="30"
|
||||
FontSize="20"
|
||||
x:Name="passwordbox"
|
||||
BorderBrush="Transparent"
|
||||
Margin="0,30,0,0"
|
||||
Background="#FF323134"
|
||||
Foreground="White"
|
||||
SelectionBrush="#FF6332A0" KeyDown="passwordbox_KeyDown"/>
|
||||
|
||||
<!-- Geburtsdatum Text -->
|
||||
<TextBlock Text="Geburtsdatum"
|
||||
Foreground="White"
|
||||
FontSize="16"
|
||||
Margin="0,20,0,-30"/>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,30,0,0">
|
||||
<TextBox Width="100"
|
||||
Height="30"
|
||||
FontSize="20"
|
||||
x:Name="bday1"
|
||||
BorderBrush="Transparent"
|
||||
Background="#FF323134"
|
||||
Foreground="White"
|
||||
SelectionBrush="#FF6332A0" KeyDown="bday1_KeyDown"/>
|
||||
<TextBox Width="100"
|
||||
Height="30"
|
||||
FontSize="20"
|
||||
x:Name="bday2"
|
||||
BorderBrush="Transparent"
|
||||
Background="#FF323134"
|
||||
Foreground="White"
|
||||
SelectionBrush="#FF6332A0" KeyDown="bday2_KeyDown"/>
|
||||
<TextBox Width="100"
|
||||
Height="30"
|
||||
FontSize="20"
|
||||
x:Name="bday3"
|
||||
BorderBrush="Transparent"
|
||||
Background="#FF323134"
|
||||
Foreground="White"
|
||||
SelectionBrush="#FF6332A0"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Checkbox -->
|
||||
<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="-21,0,240,0"/>
|
||||
<TextBlock FontSize="9" TextWrapping="Wrap" VerticalAlignment="Center" Height="24" Margin="15,0,-28,0">
|
||||
<Run Text="Ich habe die " Foreground="White"/>
|
||||
<Run x:Name="nutzungsbedingungenRun" Text="Nutzungsbedingungen" Foreground="#FF6332A0"/>
|
||||
<Run Text=" und die " Foreground="White"/>
|
||||
<Run x:Name="datenschutzRun" Text="Datenschutzerklärung" Foreground="#FF6332A0"/>
|
||||
<Run Text=" von bib-talk gelesen und akzeptiert." Foreground="White"/>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
|
||||
<Button x:Name="weiterbutton" Content="Weiter" Foreground="Gray" Background="#FF323134" BorderThickness="0" Margin="0,20,0,0" Height="30" BorderBrush="{x:Null}" Click="WeiterButton_Click" Style="{StaticResource NoHoverButtonStyle}"/>
|
||||
<Button Style="{StaticResource InvisibleButtonStyle}" Click="Login_Click">
|
||||
<TextBlock Text="Ich habe bereits einen Account"
|
||||
Foreground="#FF6332A0"
|
||||
FontSize="12"
|
||||
Width="167"
|
||||
Margin="-130,5,0,0"
|
||||
Style="{StaticResource HoverUnderlineTextBlockStyle}"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</Window>
|
190
bibtalk/bib-talk/UI/RegisterWindow.xaml.cs
Normal file
@@ -0,0 +1,190 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Navigation;
|
||||
using bib_talk.Business;
|
||||
|
||||
namespace bib_talk
|
||||
{
|
||||
public partial class RegisterWindow : Window
|
||||
{
|
||||
RegisterManager registerManager; // RegisterManager Objekt initialisieren
|
||||
|
||||
// Konstruktor für das RegisterWindow
|
||||
public RegisterWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
registerManager = new RegisterManager(this); // RegisterManager Objekt erstellen
|
||||
}
|
||||
|
||||
// Methode für das Schließen des Fensters
|
||||
private void CloseButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
// Methode für die Custom Draggable Area
|
||||
private void DraggableArea_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.ButtonState == MouseButtonState.Pressed)
|
||||
{
|
||||
DragMove();
|
||||
}
|
||||
}
|
||||
|
||||
// Methode um das Login Window aufzurufen
|
||||
private void Login_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Login login = new Login();
|
||||
login.Show();
|
||||
this.Close();
|
||||
}
|
||||
|
||||
// Methode um das Registrieren abzuschließen und das Login Window aufzurufen
|
||||
private async void WeiterButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (checkboxAGB.IsChecked == true)
|
||||
{
|
||||
if (ValidateRegistration())
|
||||
{
|
||||
// Business Schicht Aufruf
|
||||
registerManager.RegisterServer();
|
||||
|
||||
Login login = new Login();
|
||||
login.Show();
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Bitte akzeptieren Sie die AGB.");
|
||||
}
|
||||
}
|
||||
|
||||
// Methode um den Weiter Button zu aktivieren, wenn die "Nutzungsbedingungen"
|
||||
// akzeptiert wurden
|
||||
private void CheckBox_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SolidColorBrush customBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF6332A0"));
|
||||
weiterbutton.Foreground = Brushes.White;
|
||||
weiterbutton.Background = customBrush;
|
||||
}
|
||||
|
||||
// Methode um den Weiter Button zu deaktivieren, wenn die "Nutzungsbedingungen"
|
||||
// abgelehnt wurden
|
||||
private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SolidColorBrush customBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF323134"));
|
||||
weiterbutton.Foreground = Brushes.Gray;
|
||||
weiterbutton.Background = customBrush;
|
||||
}
|
||||
|
||||
// Methode um die Eingaben des Benutzers zu validieren
|
||||
private bool ValidateRegistration()
|
||||
{
|
||||
string username = usernbox.Text;
|
||||
string password = passwordbox.Password;
|
||||
string email = emailbox.Text;
|
||||
string day = bday1.Text;
|
||||
string month = bday2.Text;
|
||||
string year = bday3.Text;
|
||||
|
||||
// Benutzername validieren
|
||||
if (string.IsNullOrWhiteSpace(username) || username.Length < 3)
|
||||
{
|
||||
MessageBox.Show("Der Benutzername muss mindestens 3 Zeichen lang sein.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Passwort validieren
|
||||
if (string.IsNullOrWhiteSpace(password) || password.Length < 6 || !Regex.IsMatch(password, @"^(?=.*[A-Za-z])(?=.*\d).{6,}$"))
|
||||
{
|
||||
MessageBox.Show("Das Passwort muss mindestens 6 Zeichen lang sein und sowohl Buchstaben als auch Zahlen enthalten.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// E-Mail validieren
|
||||
if (string.IsNullOrWhiteSpace(email) || !Regex.IsMatch(email, @"^[^@\s]+@[^@\s]+\.[^@\s]+$"))
|
||||
{
|
||||
MessageBox.Show("Bitte geben Sie eine gültige E-Mail-Adresse ein.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Geburtsdatum validieren
|
||||
if (!int.TryParse(day, out int dayInt) || !int.TryParse(month, out int monthInt) || !int.TryParse(year, out int yearInt) ||
|
||||
!DateTime.TryParse($"{yearInt}-{monthInt}-{dayInt}", out DateTime birthDate) || birthDate > DateTime.Now.AddYears(-14))
|
||||
{
|
||||
MessageBox.Show("Bitte geben Sie ein gültiges Geburtsdatum ein. Sie müssen mindestens 18 Jahre alt sein.");
|
||||
return false;
|
||||
}
|
||||
|
||||
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);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
27
bibtalk/bib-talk/bib-talk.csproj
Normal file
@@ -0,0 +1,27 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<RootNamespace>bib_talk</RootNamespace>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWPF>true</UseWPF>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="logo.png" />
|
||||
<None Remove="Logo_bib-Talk.png" />
|
||||
<None Remove="PICA.jpg" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="Icons\logo.png" />
|
||||
<Resource Include="Icons\Logo_bib-Talk.png" />
|
||||
<Resource Include="Icons\PICA.jpg" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@@ -1 +0,0 @@
|
||||
erik stinkt
|