Compare commits

..

8 Commits

12 changed files with 221 additions and 266 deletions
-63
View File
@@ -1,63 +0,0 @@
###############################################################################
# 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
+79 -179
View File
@@ -1,11 +1,67 @@
## 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
###################
# compiled source #
###################
*.com
*.class
*.dll
*.exe
*.pdb
*.dll.config
*.cache
*.suo
# Include dlls if theyre in the NuGet packages directory
!/packages/*/lib/*.dll
# Include dlls if they're in the CommonReferences directory
!*CommonReferences/*.dll
####################
# VS Upgrade stuff #
####################
_UpgradeReport_Files/
###############
# Directories #
###############
bin/
obj/
TestResults/
###################
# Web publish log #
###################
*.Publish.xml
#############
# Resharper #
#############
/_ReSharper.*
*.ReSharper.*
############
# Packages #
############
# its better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
######################
# Logs and databases #
######################
*.log
*.sqlite
# OS generated files #
######################
.DS_Store?
ehthumbs.db
Icon?
Thumbs.db
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
@@ -13,9 +69,6 @@
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
@@ -23,63 +76,38 @@ mono_crash.*
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
build/
bld/
[Bb]in/
[Oo]bj/
[Oo]ut/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
# Visual Studo 2015 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
# 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
# DNX
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
*_i.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
@@ -89,8 +117,6 @@ StyleCopReport.xml
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
@@ -105,21 +131,14 @@ _Chutzpah*
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/
@@ -132,29 +151,18 @@ _ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# 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.*
@@ -182,182 +190,74 @@ publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# TODO: 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/*
**/packages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
!**/packages/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
#!**/packages/repositories.config
# Microsoft Azure Build Output
# Windows Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
# Windows Store app package directory
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/
!*.[Cc]ache/
# Others
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
node_modules/
bower_components/
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 ;-)
# 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
-12
View File
@@ -1,12 +0,0 @@
<Window x:Class="Lotto_WPF.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"
xmlns:local="clr-namespace:Lotto_WPF"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
</Grid>
</Window>
+6 -6
View File
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.13.35931.197 d17.13
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lotto_WPF", "Lotto_WPF\Lotto_WPF.csproj", "{11508812-14FF-4C7C-A0C8-D446CE063F66}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lotto_Wpf", "Lotto_Wpf\Lotto_Wpf.csproj", "{E54485DB-84A3-45CA-98CB-C10347CA8CC4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -11,15 +11,15 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{11508812-14FF-4C7C-A0C8-D446CE063F66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{11508812-14FF-4C7C-A0C8-D446CE063F66}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11508812-14FF-4C7C-A0C8-D446CE063F66}.Release|Any CPU.ActiveCfg = Release|Any CPU
{11508812-14FF-4C7C-A0C8-D446CE063F66}.Release|Any CPU.Build.0 = Release|Any CPU
{E54485DB-84A3-45CA-98CB-C10347CA8CC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E54485DB-84A3-45CA-98CB-C10347CA8CC4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E54485DB-84A3-45CA-98CB-C10347CA8CC4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E54485DB-84A3-45CA-98CB-C10347CA8CC4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {49FFDDEF-C3C0-40D5-A88F-39460E29B7AC}
SolutionGuid = {AB474776-D9C7-4AE0-9D9B-1DC4F8AB430D}
EndGlobalSection
EndGlobal
@@ -1,7 +1,7 @@
<Application x:Class="Lotto_WPF.App"
<Application x:Class="Lotto_Wpf.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Lotto_WPF"
xmlns:local="clr-namespace:Lotto_Wpf"
StartupUri="MainWindow.xaml">
<Application.Resources>
@@ -2,7 +2,7 @@
using System.Data;
using System.Windows;
namespace Lotto_WPF
namespace Lotto_Wpf
{
/// <summary>
/// Interaction logic for App.xaml
+131
View File
@@ -0,0 +1,131 @@
<Window x:Class="LottoApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Lotto App" Height="600" Width="800"
Background="#1e1e1e"
WindowStartupLocation="CenterScreen"
Loaded="Window_Loaded">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Background="#111" Orientation="Vertical">
<TextBlock Text="LOTTO" FontSize="16" FontWeight="Bold"
Foreground="White" Margin="0,20,0,20"
HorizontalAlignment="Center"/>
<Button Content="Home" FontSize="12" Margin="10" Background="Transparent" Foreground="White"/>
<Button Content="Spiel" FontSize="12" Margin="10" Background="Transparent" Foreground="White"/>
<Button Content="Geschichte" FontSize="12" Margin="10" Background="Transparent" Foreground="White"/>
</StackPanel>
<!-- Main -->
<StackPanel Grid.Column="1" Margin="20">
<TextBlock Text="Lotto " FontSize="28" FontWeight="Bold" Foreground="White" Margin="0,0,0,20"/>
<UniformGrid x:Name="NumberGrid" Rows="7" Columns="7" Margin="0,0,0,20"/>
<TextBlock x:Name="SelectedNumbersText" Foreground="White" FontSize="16" Margin="0,0,0,10"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,10,0,0">
<Button Content="Wahlen" Width="100" Margin="0,0,10,0" Click="QuickPick_Click"/>
<Button Content="Loschen" Width="75" Margin="0,0,10,0" Click="Clear_Click"/>
</StackPanel>
</StackPanel>
<x:Code>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
List<int> selectedNumbers = new List<int>();
void Window_Loaded(object sender, RoutedEventArgs e)
{
for (int i = 1; i <= 49; i++)
{
Button btn = new Button
{
Content = i.ToString(),
Margin = new Thickness(5),
Background = Brushes.LightGray,
Foreground = Brushes.Black,
Tag = i
};
btn.Click += NumberButton_Click;
NumberGrid.Children.Add(btn);
}
}
void NumberButton_Click(object sender, RoutedEventArgs e)
{
Button btn = sender as Button;
int number = (int)btn.Tag;
if (selectedNumbers.Contains(number))
{
selectedNumbers.Remove(number);
btn.Background = Brushes.LightGray;
}
else if (selectedNumbers.Count < 6)
{
selectedNumbers.Add(number);
btn.Background = Brushes.Orange;
}
SelectedNumbersText.Text = string.Join(", ", selectedNumbers.OrderBy(n => n));
}
void QuickPick_Click(object sender, RoutedEventArgs e)
{
Random rand = new Random();
selectedNumbers.Clear();
var buttons = NumberGrid.Children.OfType<Button>().ToList();
foreach (Button btn in buttons)
btn.Background = Brushes.LightGray;
while (selectedNumbers.Count < 6)
{
int n = rand.Next(1, 50);
if (!selectedNumbers.Contains(n))
selectedNumbers.Add(n);
}
foreach (Button btn in buttons)
{
if (selectedNumbers.Contains((int)btn.Tag))
btn.Background = Brushes.Orange;
}
SelectedNumbersText.Text = string.Join(", ", selectedNumbers.OrderBy(n => n));
}
void Clear_Click(object sender, RoutedEventArgs e)
{
selectedNumbers.Clear();
foreach (Button btn in NumberGrid.Children.OfType<Button>())
btn.Background = Brushes.LightGray;
SelectedNumbersText.Text = "";
}
void Submit_Click(object sender, RoutedEventArgs e)
{
if (selectedNumbers.Count != 6)
{
MessageBox.Show("Please select exactly 6 numbers.");
return;
}
MessageBox.Show("Numbers submitted: " + string.Join(", ", selectedNumbers.OrderBy(n => n)));
}
]]>
</x:Code>
</Grid>
</Window>
@@ -9,7 +9,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Lotto_WPF
namespace Lotto_Wpf
{
/// <summary>
/// Interaction logic for MainWindow.xaml
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
# Lotto_WPF