Commit 609ffc2e authored by Uwe Wienkop's avatar Uwe Wienkop

2020-06-17 Mi

parent 540692b9
......@@ -7,8 +7,8 @@
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<Button Content="Mein bester Button" HorizontalAlignment="Left" Margin="190,134,0,0" VerticalAlignment="Top" Width="136" Click="Button_Click"/>
<Label x:Name="meinLabel" Content="Label" HorizontalAlignment="Left" Margin="208,240,0,0" VerticalAlignment="Top"/>
<Button Content="Mein bester Button" HorizontalAlignment="Left" Margin="175,74,0,0" VerticalAlignment="Top" Width="136" Click="Button_Click" MouseEnter="Button_Enter" MouseLeave="Button_Leave"/>
<Label x:Name="meinLabel" Content="Label" HorizontalAlignment="Left" Margin="175,122,0,0" VerticalAlignment="Top"/>
<TextBox HorizontalAlignment="Left" Height="23" Margin="344,190,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="120"/>
</Grid>
......
......@@ -30,5 +30,16 @@ namespace _01WPF_Demo
{
meinLabel.Content = $"{++zaehler}";
}
private void Button_Leave(object sender, MouseEventArgs e)
{
meinLabel.Content = "Cursor hat den Button verlassen";
}
private void Button_Enter(object sender, MouseEventArgs e)
{
meinLabel.Content = "Cursor ist in den Button hineingefahren";
}
}
}
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "D57DCAC845907026F457BE8740727CDBDE7747C795BBCA7CC8A9E6E1650A5F23"
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "BB8A4076F3A4279E9326BFFEE23045B977190285315B850B97003E566855B1E0"
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
......@@ -83,6 +83,18 @@ namespace _01WPF_Demo {
#line 10 "..\..\MainWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);
#line default
#line hidden
#line 10 "..\..\MainWindow.xaml"
((System.Windows.Controls.Button)(target)).MouseEnter += new System.Windows.Input.MouseEventHandler(this.Button_Enter);
#line default
#line hidden
#line 10 "..\..\MainWindow.xaml"
((System.Windows.Controls.Button)(target)).MouseLeave += new System.Windows.Input.MouseEventHandler(this.Button_Leave);
#line default
#line hidden
return;
......
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "D57DCAC845907026F457BE8740727CDBDE7747C795BBCA7CC8A9E6E1650A5F23"
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "BB8A4076F3A4279E9326BFFEE23045B977190285315B850B97003E566855B1E0"
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
......@@ -83,6 +83,18 @@ namespace _01WPF_Demo {
#line 10 "..\..\MainWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);
#line default
#line hidden
#line 10 "..\..\MainWindow.xaml"
((System.Windows.Controls.Button)(target)).MouseEnter += new System.Windows.Input.MouseEventHandler(this.Button_Enter);
#line default
#line hidden
#line 10 "..\..\MainWindow.xaml"
((System.Windows.Controls.Button)(target)).MouseLeave += new System.Windows.Input.MouseEventHandler(this.Button_Leave);
#line default
#line hidden
return;
......
......@@ -3,9 +3,10 @@
namespace _08MulticastDelegate
{
delegate void MeinDelegate(string s);
class TestClass
{
public enum Ampelfarben { rot, gelb, grün };
// Define two methods that have the same signature as CustomDel.
static void Hello(string s)
{
......
......@@ -5,6 +5,7 @@ namespace _09_DelegateVerkettung
class Program
{
delegate void StringDelegate(ref string s);
static StringDelegate stringdelegate;
static string Ausgabe(string s)
{
......@@ -29,8 +30,8 @@ namespace _09_DelegateVerkettung
{
StringDelegate tmp = delegate (ref string s) { s = s.Substring(1); };
stringdelegate += InGrossbuchstaben; // Ausführung in der Reihenfolge
stringdelegate += tmp;
// des +=
stringdelegate += tmp; // des +=
stringdelegate += Mitte;
stringdelegate -= tmp;
// Achtung!!! Anonyme Methoden können nicht entfernt werden
......
......@@ -80,8 +80,7 @@ namespace _09_UebgMailVerteilung
mb.Senden("Geheime Nachricht"); // wird an alle registrierten Empfänger gesendet
Console.WriteLine("In Firma B gespeichert: " + FirmaB.Gespeichert);
mb.Senden("Ein schönen guten Morgen");
Console.WriteLine("In Firma B gespeichert: " + FirmaB.Gespeichert);
Console.WriteLine("In Firma B gespeichert: " + FirmaB.Gespeichert);
}
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>_09DataDriven</RootNamespace>
</PropertyGroup>
</Project>
using System;
namespace _09DataDriven
{
delegate void Seiteneffekt(int x);
class MyData
{
private int data;
public event Seiteneffekt ausgabe;
public int Content
{
get
{
Console.WriteLine($"Get: {data}"); return data;
}
set
{
data = value;
Console.WriteLine($"Set: {data}");
ausgabe?.Invoke(data);
}
}
}
class Ausgabeaufbereitungen
{
public static void Textausgabe(int x)
{
Console.WriteLine(x);
}
public static void Balkenanzeige(int x)
{
for (int i = 0; i < x; i++)
{
Console.Write('x');
}
Console.WriteLine();
}
}
class Program
{
static void Main(string[] args)
{
MyData x1 = new MyData();
x1.ausgabe += Ausgabeaufbereitungen.Balkenanzeige;
MyData x2 = new MyData();
x2.ausgabe += Ausgabeaufbereitungen.Textausgabe;
x1.Content = 10;
x2.Content = 20;
x1.Content += 5; // x1.Content.set(x1.Content.Get ())
x2.Content *= 3;
x1.Content = (int)(8 * Math.PI);
}
}
}
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v3.1",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v3.1": {
"09DataDriven/1.0.0": {
"runtime": {
"09DataDriven.dll": {}
}
}
}
},
"libraries": {
"09DataDriven/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}
\ No newline at end of file
{
"runtimeOptions": {
"additionalProbingPaths": [
"C:\\Users\\wienkop\\.dotnet\\store\\|arch|\\|tfm|",
"C:\\Users\\wienkop\\.nuget\\packages"
]
}
}
\ No newline at end of file
{
"runtimeOptions": {
"tfm": "netcoreapp3.1",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "3.1.0"
}
}
}
\ No newline at end of file
{
"format": 1,
"restore": {
"C:\\Users\\wienkop\\source\\repos\\prog2-ss2020-wienkop\\09DataDriven\\09DataDriven.csproj": {}
},
"projects": {
"C:\\Users\\wienkop\\source\\repos\\prog2-ss2020-wienkop\\09DataDriven\\09DataDriven.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\wienkop\\source\\repos\\prog2-ss2020-wienkop\\09DataDriven\\09DataDriven.csproj",
"projectName": "09DataDriven",
"projectPath": "C:\\Users\\wienkop\\source\\repos\\prog2-ss2020-wienkop\\09DataDriven\\09DataDriven.csproj",
"packagesPath": "C:\\Users\\wienkop\\.nuget\\packages\\",
"outputPath": "C:\\Users\\wienkop\\source\\repos\\prog2-ss2020-wienkop\\09DataDriven\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\wienkop\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"netcoreapp3.1"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"netcoreapp3.1": {
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"netcoreapp3.1": {
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json"
}
}
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\wienkop\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.6.0</NuGetToolVersion>
</PropertyGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
</Project>
\ No newline at end of file
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v3.1", FrameworkDisplayName = "")]
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("09DataDriven")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("09DataDriven")]
[assembly: System.Reflection.AssemblyTitleAttribute("09DataDriven")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Von der MSBuild WriteCodeFragment-Klasse generiert.
C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\09DataDriven\bin\Debug\netcoreapp3.1\09DataDriven.exe
C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\09DataDriven\bin\Debug\netcoreapp3.1\09DataDriven.deps.json
C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\09DataDriven\bin\Debug\netcoreapp3.1\09DataDriven.runtimeconfig.json
C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\09DataDriven\bin\Debug\netcoreapp3.1\09DataDriven.runtimeconfig.dev.json
C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\09DataDriven\bin\Debug\netcoreapp3.1\09DataDriven.dll
C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\09DataDriven\bin\Debug\netcoreapp3.1\09DataDriven.pdb
C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\09DataDriven\obj\Debug\netcoreapp3.1\09DataDriven.AssemblyInfoInputs.cache
C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\09DataDriven\obj\Debug\netcoreapp3.1\09DataDriven.AssemblyInfo.cs
C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\09DataDriven\obj\Debug\netcoreapp3.1\09DataDriven.csproj.CoreCompileInputs.cache
C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\09DataDriven\obj\Debug\netcoreapp3.1\09DataDriven.dll
C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\09DataDriven\obj\Debug\netcoreapp3.1\09DataDriven.pdb
C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\09DataDriven\obj\Debug\netcoreapp3.1\09DataDriven.genruntimeconfig.cache
{
"version": 3,
"targets": {
".NETCoreApp,Version=v3.1": {}
},
"libraries": {},
"projectFileDependencyGroups": {
".NETCoreApp,Version=v3.1": []
},
"packageFolders": {
"C:\\Users\\wienkop\\.nuget\\packages\\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\wienkop\\source\\repos\\prog2-ss2020-wienkop\\09DataDriven\\09DataDriven.csproj",
"projectName": "09DataDriven",
"projectPath": "C:\\Users\\wienkop\\source\\repos\\prog2-ss2020-wienkop\\09DataDriven\\09DataDriven.csproj",
"packagesPath": "C:\\Users\\wienkop\\.nuget\\packages\\",
"outputPath": "C:\\Users\\wienkop\\source\\repos\\prog2-ss2020-wienkop\\09DataDriven\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\wienkop\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"netcoreapp3.1"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"netcoreapp3.1": {
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"netcoreapp3.1": {
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json"
}
}
}
}
\ No newline at end of file
{
"version": 2,
"dgSpecHash": "Fcb4oPUf+qnxtgvOEOkjbJb9iMDciq8eFL9fciFi4kv4CK7hi4AhoNtkaEjO7lKRoljDrRRpHyD+00zFE7cSyg==",
"success": true,
"projectFilePath": "C:\\Users\\wienkop\\source\\repos\\prog2-ss2020-wienkop\\09DataDriven\\09DataDriven.csproj",
"expectedPackageFiles": [],
"logs": []
}
\ No newline at end of file
......@@ -7,7 +7,6 @@ namespace MailServer
delegate void SpamCheckerDelegate(Mail mail);
class MailServer
{
// Regeln Mail-->bool, Mail->Mail
public event SpamCheckerDelegate spamchecker;
public void Send(Mail mail)
{
......
......@@ -6,15 +6,34 @@ namespace MailServer
{
static void mySpamChecker(Mail m)
{
if (m.Body.Contains("Supersonderangebot"))
string[] spamWords = { "Supersonderangebot", "BestBuy" };
bool spam = false;
foreach (var item in spamWords)
{
if (m.Header.Contains(item) || m.Body.Contains(item))
{
spam = true;
break;
}
}
if (spam)
{
m.Header = "[SPAM] " + m.Header;
}
}
static void myChecker2(Mail m)
{
if (m.Header.Contains("Newsletter"))
m.Body = "Schon wieder ein Newsletter, nur nicht lesen";
}
static void Main(string[] args)
{
MailServer ms = new MailServer();
ms.spamchecker += mySpamChecker;
//ms.spamchecker += myChecker2;
ms.Send(new Mail("BestBuy Newsletter", "Hier erhalten Sie unser Supersonderangebot"));
}
}
}
......@@ -10,3 +10,4 @@ C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\09TestProjekt\obj\Debug\netco
C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\09TestProjekt\obj\Debug\netcoreapp3.1\09 MailServer.dll
C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\09TestProjekt\obj\Debug\netcoreapp3.1\09 MailServer.pdb
C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\09TestProjekt\obj\Debug\netcoreapp3.1\09 MailServer.genruntimeconfig.cache
C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\09TestProjekt\obj\Debug\netcoreapp3.1\09 MailServer.csprojAssemblyReference.cache
......@@ -108,7 +108,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "09 MailServer", "09TestProj
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "09 UebgDiMailVerteilung", "09 UebgMailVerteilung\09 UebgDiMailVerteilung.csproj", "{1299E185-D763-4A24-8D6E-A39BAED9398E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "09 DelegateVerkettung", "09 DelegateVerkettung\09 DelegateVerkettung.csproj", "{17A26633-0F72-4889-B31E-9A29A80CE4A5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "09 DelegateVerkettung", "09 DelegateVerkettung\09 DelegateVerkettung.csproj", "{17A26633-0F72-4889-B31E-9A29A80CE4A5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "09DataDriven", "09DataDriven\09DataDriven.csproj", "{4E2ED939-4FFF-4A44-8ACD-13E0CF23E1FB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......@@ -320,6 +322,10 @@ Global
{17A26633-0F72-4889-B31E-9A29A80CE4A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{17A26633-0F72-4889-B31E-9A29A80CE4A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{17A26633-0F72-4889-B31E-9A29A80CE4A5}.Release|Any CPU.Build.0 = Release|Any CPU
{4E2ED939-4FFF-4A44-8ACD-13E0CF23E1FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4E2ED939-4FFF-4A44-8ACD-13E0CF23E1FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4E2ED939-4FFF-4A44-8ACD-13E0CF23E1FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4E2ED939-4FFF-4A44-8ACD-13E0CF23E1FB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment