Commit b9a91c84 authored by CompileNix's avatar CompileNix
Browse files

Initial - 2012-10-05.2331

parents
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
project.fragment.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.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
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_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
# 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
# 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
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable 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
# 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
node_modules/
orleans.codegen.cs
# 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
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# 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/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HundeVerwaltung", "HundeVerwaltung\HundeVerwaltung.csproj", "{6FDFE3BA-D5DA-417B-B97C-77C8AD398D50}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6FDFE3BA-D5DA-417B-B97C-77C8AD398D50}.Debug|x64.ActiveCfg = Debug|x64
{6FDFE3BA-D5DA-417B-B97C-77C8AD398D50}.Debug|x64.Build.0 = Debug|x64
{6FDFE3BA-D5DA-417B-B97C-77C8AD398D50}.Debug|x86.ActiveCfg = Debug|x86
{6FDFE3BA-D5DA-417B-B97C-77C8AD398D50}.Debug|x86.Build.0 = Debug|x86
{6FDFE3BA-D5DA-417B-B97C-77C8AD398D50}.Release|x64.ActiveCfg = Release|x64
{6FDFE3BA-D5DA-417B-B97C-77C8AD398D50}.Release|x64.Build.0 = Release|x64
{6FDFE3BA-D5DA-417B-B97C-77C8AD398D50}.Release|x86.ActiveCfg = Release|x86
{6FDFE3BA-D5DA-417B-B97C-77C8AD398D50}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
namespace HundeVerwaltung
{
partial class HundeVerwaltung
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HundeVerwaltung));
this.buttonNewHund = new System.Windows.Forms.Button();
this.richTextBoxOutput = new System.Windows.Forms.RichTextBox();
this.textBoxHundName = new System.Windows.Forms.TextBox();
this.numericUpDownHundSize = new System.Windows.Forms.NumericUpDown();
this.dataGridView = new System.Windows.Forms.DataGridView();
this.HundName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.HundSize = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.buttonBellen = new System.Windows.Forms.Button();
this.buttonClear = new System.Windows.Forms.Button();
this.buttonDel = new System.Windows.Forms.Button();
this.numericUpDownCountOfBark = new System.Windows.Forms.NumericUpDown();
this.textBoxHundNameCurrent = new System.Windows.Forms.TextBox();
this.numericUpDownHundSizeCurrent = new System.Windows.Forms.NumericUpDown();
this.buttonUebernehmen = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownHundSize)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownCountOfBark)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownHundSizeCurrent)).BeginInit();
this.SuspendLayout();
//
// buttonNewHund
//
resources.ApplyResources(this.buttonNewHund, "buttonNewHund");
this.buttonNewHund.Name = "buttonNewHund";
this.buttonNewHund.UseVisualStyleBackColor = true;
this.buttonNewHund.Click += new System.EventHandler(this.buttonNewHund_Click);
//
// richTextBoxOutput
//
resources.ApplyResources(this.richTextBoxOutput, "richTextBoxOutput");
this.richTextBoxOutput.Name = "richTextBoxOutput";
this.richTextBoxOutput.ReadOnly = true;
//
// textBoxHundName
//
resources.ApplyResources(this.textBoxHundName, "textBoxHundName");
this.textBoxHundName.Name = "textBoxHundName";
this.textBoxHundName.Enter += new System.EventHandler(this.textBoxHundName_Enter);
this.textBoxHundName.Leave += new System.EventHandler(this.textBoxHundName_Leave);
//
// numericUpDownHundSize
//
resources.ApplyResources(this.numericUpDownHundSize, "numericUpDownHundSize");
this.numericUpDownHundSize.Name = "numericUpDownHundSize";
//
// dataGridView
//
this.dataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.HundName,
this.HundSize});
resources.ApplyResources(this.dataGridView, "dataGridView");
this.dataGridView.Name = "dataGridView";
this.dataGridView.ReadOnly = true;
this.dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dataGridView.SelectionChanged += new System.EventHandler(this.dataGridView_SelectionChanged);
//
// HundName
//
this.HundName.DataPropertyName = "Name";
resources.ApplyResources(this.HundName, "HundName");
this.HundName.Name = "HundName";
this.HundName.ReadOnly = true;
//
// HundSize
//
this.HundSize.DataPropertyName = "Size";
resources.ApplyResources(this.HundSize, "HundSize");
this.HundSize.Name = "HundSize";
this.HundSize.ReadOnly = true;
//
// buttonBellen
//
resources.ApplyResources(this.buttonBellen, "buttonBellen");
this.buttonBellen.Name = "buttonBellen";
this.buttonBellen.UseVisualStyleBackColor = true;
this.buttonBellen.Click += new System.EventHandler(this.buttonBellen_Click);
//
// buttonClear
//
resources.ApplyResources(this.buttonClear, "buttonClear");
this.buttonClear.Name = "buttonClear";
this.buttonClear.UseVisualStyleBackColor = true;
this.buttonClear.Click += new System.EventHandler(this.buttonClear_Click);
//
// buttonDel
//
resources.ApplyResources(this.buttonDel, "buttonDel");
this.buttonDel.Name = "buttonDel";
this.buttonDel.UseVisualStyleBackColor = true;
this.buttonDel.Click += new System.EventHandler(this.buttonDel_Click);
//
// numericUpDownCountOfBark
//
resources.ApplyResources(this.numericUpDownCountOfBark, "numericUpDownCountOfBark");
this.numericUpDownCountOfBark.Name = "numericUpDownCountOfBark";
this.numericUpDownCountOfBark.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// textBoxHundNameCurrent
//
resources.ApplyResources(this.textBoxHundNameCurrent, "textBoxHundNameCurrent");
this.textBoxHundNameCurrent.Name = "textBoxHundNameCurrent";
this.textBoxHundNameCurrent.Enter += new System.EventHandler(this.textBoxHundNameCurrent_Enter);
this.textBoxHundNameCurrent.Leave += new System.EventHandler(this.textBoxHundNameCurrent_Leave);
//
// numericUpDownHundSizeCurrent
//
resources.ApplyResources(this.numericUpDownHundSizeCurrent, "numericUpDownHundSizeCurrent");
this.numericUpDownHundSizeCurrent.Name = "numericUpDownHundSizeCurrent";
//
// buttonUebernehmen
//
resources.ApplyResources(this.buttonUebernehmen, "buttonUebernehmen");
this.buttonUebernehmen.Name = "buttonUebernehmen";
this.buttonUebernehmen.UseVisualStyleBackColor = true;
this.buttonUebernehmen.Click += new System.EventHandler(this.buttonUebernehmen_Click);
//
// HundeVerwaltung
//
this.AcceptButton = this.buttonNewHund;
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonDel);
this.Controls.Add(this.buttonClear);
this.Controls.Add(this.buttonBellen);
this.Controls.Add(this.dataGridView);
this.Controls.Add(this.numericUpDownCountOfBark);
this.Controls.Add(this.numericUpDownHundSizeCurrent);
this.Controls.Add(this.numericUpDownHundSize);
this.Controls.Add(this.textBoxHundNameCurrent);
this.Controls.Add(this.textBoxHundName);
this.Controls.Add(this.richTextBoxOutput);
this.Controls.Add(this.buttonUebernehmen);
this.Controls.Add(this.buttonNewHund);
this.MaximizeBox = false;
this.Name = "HundeVerwaltung";
this.ShowIcon = false;
this.Load += new System.EventHandler(this.HundeVerwaltung_Load);
((System.ComponentModel.ISupportInitialize)(this.numericUpDownHundSize)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownCountOfBark)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownHundSizeCurrent)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonNewHund;
private System.Windows.Forms.RichTextBox richTextBoxOutput;
private System.Windows.Forms.TextBox textBoxHundName;
private System.Windows.Forms.NumericUpDown numericUpDownHundSize;
private System.Windows.Forms.DataGridView dataGridView;
private System.Windows.Forms.DataGridViewTextBoxColumn HundName;
private System.Windows.Forms.DataGridViewTextBoxColumn HundSize;
private System.Windows.Forms.Button buttonBellen;
private System.Windows.Forms.Button buttonClear;
private System.Windows.Forms.Button buttonDel;
private System.Windows.Forms.NumericUpDown numericUpDownCountOfBark;
private System.Windows.Forms.TextBox textBoxHundNameCurrent;
private System.Windows.Forms.NumericUpDown numericUpDownHundSizeCurrent;
private System.Windows.Forms.Button buttonUebernehmen;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace HundeVerwaltung {
public partial class HundeVerwaltung : Form {
public const String cTextBoxHundName = "Name";
public const int cNumericUpDown = 0;
private BindingList<Hund> listHunde = new BindingList<Hund>();
DataGridViewSelectedRowCollection dataGridSelectedRowsCollection;
public HundeVerwaltung() {
InitializeComponent();
}
private void buttonNewHund_Click(object sender, EventArgs e) {
if (!textBoxHundName.Text.Equals(cTextBoxHundName)) {
listHunde.Add(new Hund((int)numericUpDownHundSize.Value, textBoxHundName.Text));
richTextBoxOutput.AppendText("\nEin neuer Hund wurde konstruiert:" + textBoxHundName.Text +" Größe:" +numericUpDownHundSize.Value);
numericUpDownHundSize.Value = cNumericUpDown;
textBoxHundName.Text = cTextBoxHundName;
}
}
private void textBoxHundName_Enter(object sender, EventArgs e) {
if (textBoxHundName.Text.Equals(cTextBoxHundName)) {
textBoxHundName.Text = "";
}
}
private void textBoxHundName_Leave(object sender, EventArgs e) {
if (textBoxHundName.Text.Equals("")) {
textBoxHundName.Text = cTextBoxHundName;
}
}
private void HundeVerwaltung_Load(object sender, EventArgs e) {
dataGridView.AutoGenerateColumns = false;
dataGridView.DataSource = listHunde;
}
private void buttonBellen_Click(object sender, EventArgs e) {
dataGridSelectedRowsCollection = dataGridView.SelectedRows;
if (numericUpDownCountOfBark.Value > 0 & dataGridSelectedRowsCollection.Count > 0) {
for (int i = 0; i < numericUpDownCountOfBark.Value; i++) {
bark();
}
}
}
private void buttonClear_Click(object sender, EventArgs e) {
richTextBoxOutput.Clear();
}
private void buttonDel_Click(object sender, EventArgs e) {
dataGridSelectedRowsCollection = dataGridView.SelectedRows;
if (dataGridSelectedRowsCollection.Count > 0) {
try {
foreach (DataGridViewRow tmpSelRow in dataGridSelectedRowsCollection) {
Hund tmpHund = (Hund)tmpSelRow.DataBoundItem;
richTextBoxOutput.AppendText("\n" + tmpHund.Name + ": dieser Hund wurde dekonstruiert");
listHunde.Remove(tmpHund);
}
} catch (Exception ex) {
System.Console.Write(ex.StackTrace);
}
}
}
private void bark() {
try {
foreach (DataGridViewRow tmpSelRow in dataGridSelectedRowsCollection) {
Hund tmpHund = (Hund)tmpSelRow.DataBoundItem;
richTextBoxOutput.AppendText("\n" + tmpHund.Name + ":" + tmpHund.Bellen());
}
} catch (Exception ex) {
System.Console.Write(ex.StackTrace);
}
}
private void dataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) {
}
private void buttonUebernehmen_Click(object sender, EventArgs e) {
dataGridSelectedRowsCollection = dataGridView.SelectedRows;
int tmpHundRow;
try {
tmpHundRow = dataGridSelectedRowsCollection[0].Cells[0].RowIndex;
Hund tmpHund = (Hund)dataGridSelectedRowsCollection[0].DataBoundItem;
listHunde.Insert(tmpHundRow + 1, new Hund((int)numericUpDownHundSizeCurrent.Value, textBoxHundNameCurrent.Text));
listHunde.Remove(tmpHund);
} catch (Exception ex) {
System.Console.Write(ex.StackTrace);
}
}
private void textBoxHundNameCurrent_Enter(object sender, EventArgs e) {
if (textBoxHundNameCurrent.Text.Equals(cTextBoxHundName)) {
textBoxHundNameCurrent.Text = "";
}
}
private void textBoxHundNameCurrent_Leave(object sender, EventArgs e) {
if (textBoxHundNameCurrent.Text.Equals("")) {
textBoxHundNameCurrent.Text = cTextBoxHundName;
}
}
private void dataGridView_SelectionChanged(object sender, EventArgs e) {
dataGridSelectedRowsCollection = dataGridView.SelectedRows;
if (dataGridSelectedRowsCollection.Count == 1) {
try {
Hund tmpHund = (Hund)dataGridSelectedRowsCollection[0].DataBoundItem;
if (!tmpHund.Name.Equals(Hund.cName) || !tmpHund.Size.Equals(Hund.cSize)) {
textBoxHundNameCurrent.Text = tmpHund.Name;
numericUpDownHundSizeCurrent.Value = tmpHund.Size;
} else {
textBoxHundNameCurrent.Text = "";
numericUpDownHundSizeCurrent.Value = cNumericUpDown;
}
} catch (Exception ex) {
System.Console.Write(ex.StackTrace);
}
}
}