diff --git a/.vs/prog2-ss2020-wienkop/DesignTimeBuild/.dtbcache.v2 b/.vs/prog2-ss2020-wienkop/DesignTimeBuild/.dtbcache.v2 index ff1d5435a374926923f0cc4b6e006839c462d85d..4f61acebc3cc84569cbfc6c890d0bb72cf8c0e20 100644 Binary files a/.vs/prog2-ss2020-wienkop/DesignTimeBuild/.dtbcache.v2 and b/.vs/prog2-ss2020-wienkop/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/prog2-ss2020-wienkop/v16/.suo b/.vs/prog2-ss2020-wienkop/v16/.suo index 899629496ac619fe831e2c29927d30d3dd1757d1..67bc9f165757c7f53314223f784856501bf1b145 100644 Binary files a/.vs/prog2-ss2020-wienkop/v16/.suo and b/.vs/prog2-ss2020-wienkop/v16/.suo differ diff --git a/01KlassenWiederholung/obj/Debug/netcoreapp3.1/01KlassenWiederholung.csprojAssemblyReference.cache b/01KlassenWiederholung/obj/Debug/netcoreapp3.1/01KlassenWiederholung.csprojAssemblyReference.cache index 2be1eb9436f100311e0dd5f2079d8cf088d02bed..b01fdefe6d6122e34f0e3a127f2d54987f05cf92 100644 Binary files a/01KlassenWiederholung/obj/Debug/netcoreapp3.1/01KlassenWiederholung.csprojAssemblyReference.cache and b/01KlassenWiederholung/obj/Debug/netcoreapp3.1/01KlassenWiederholung.csprojAssemblyReference.cache differ diff --git a/01OperatorOverloading/obj/Debug/netcoreapp3.1/01OperatorOverloading.csprojAssemblyReference.cache b/01OperatorOverloading/obj/Debug/netcoreapp3.1/01OperatorOverloading.csprojAssemblyReference.cache index e28262d5162214555e98c87e10dac15f545c65fb..2fec08a7d21f7b5904a28ab5a2995a537eacb56b 100644 Binary files a/01OperatorOverloading/obj/Debug/netcoreapp3.1/01OperatorOverloading.csprojAssemblyReference.cache and b/01OperatorOverloading/obj/Debug/netcoreapp3.1/01OperatorOverloading.csprojAssemblyReference.cache differ diff --git a/02 Uebg KlasseTimeOpOverloading/obj/Debug/netcoreapp3.1/02 UebgMo KlasseTimeOpOverloading.csprojAssemblyReference.cache b/02 Uebg KlasseTimeOpOverloading/obj/Debug/netcoreapp3.1/02 UebgMo KlasseTimeOpOverloading.csprojAssemblyReference.cache index 50beef42e5ef19628fe73d78013cf307822ef6ea..a3dc7452ef70e739a100ce883ea2937592e63c8a 100644 Binary files a/02 Uebg KlasseTimeOpOverloading/obj/Debug/netcoreapp3.1/02 UebgMo KlasseTimeOpOverloading.csprojAssemblyReference.cache and b/02 Uebg KlasseTimeOpOverloading/obj/Debug/netcoreapp3.1/02 UebgMo KlasseTimeOpOverloading.csprojAssemblyReference.cache differ diff --git a/07InterfaceStack/Program.cs b/07InterfaceStack/Program.cs index 1037407245c129166d174affe4e230b0136ce704..ca1e47854657a78cad1df40360c607b9275ba852 100644 --- a/07InterfaceStack/Program.cs +++ b/07InterfaceStack/Program.cs @@ -77,8 +77,8 @@ namespace _06InterfaceStack { static void Main(string[] args) { - //IStack<string> stack1 = new ArrayStack<string>(); - IStack<string> stack1 = new ListStack<string>(); + IStack<string> stack1 = new ArrayStack<string>(); + //IStack<string> stack1 = new ListStack<string>(); //IStack<string> stack1 = new IStack<string>(); // Nicht zulässig, da IStack<> eine abstrakte Klasse ist! stack1.Push("Anton"); diff --git a/12Interfaces/12Interfaces.csproj b/12Interfaces/12Interfaces.csproj new file mode 100644 index 0000000000000000000000000000000000000000..184b627663db4dbbebe7d353d71068d767602458 --- /dev/null +++ b/12Interfaces/12Interfaces.csproj @@ -0,0 +1,9 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <OutputType>Exe</OutputType> + <TargetFramework>netcoreapp3.1</TargetFramework> + <RootNamespace>_12Interfaces</RootNamespace> + </PropertyGroup> + +</Project> diff --git a/12Interfaces/Program.cs b/12Interfaces/Program.cs new file mode 100644 index 0000000000000000000000000000000000000000..5364d4486c4b832259c3b5d8069633794061f6ad --- /dev/null +++ b/12Interfaces/Program.cs @@ -0,0 +1,45 @@ +using System; + +namespace _12Interfaces +{ + interface IStackable + { + void Push(int z); + int Pop(); + } + + //abstract class Stack + //{ + // abstract public void Push(int z); + // abstract public int Pop(); + //} + + class Stack : IStackable + { + int[] speicher = new int[10]; + int count = 0; + public int Pop()=> speicher[--count]; + public void Push(int z) + { + speicher[count++] = z; + } + public int Count { get => count; } + } + class Program + { + static void Main(string[] args) + { + Stack stapel = new Stack(); + + stapel.Push(10); + stapel.Push(20); + stapel.Push(30); + Console.WriteLine(stapel.Pop()); + Console.WriteLine(stapel.Pop()); + + Console.WriteLine(stapel.Count); //-- geht nicht, da stat.Typ von stapel IStack ist + Console.WriteLine((stapel as Stack).Count); + } + } +} + \ No newline at end of file diff --git a/12Interfaces/bin/Debug/netcoreapp3.1/12Interfaces.deps.json b/12Interfaces/bin/Debug/netcoreapp3.1/12Interfaces.deps.json new file mode 100644 index 0000000000000000000000000000000000000000..b2890ddb1b81143eeaf24d37dfc273c439914d68 --- /dev/null +++ b/12Interfaces/bin/Debug/netcoreapp3.1/12Interfaces.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v3.1", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v3.1": { + "12Interfaces/1.0.0": { + "runtime": { + "12Interfaces.dll": {} + } + } + } + }, + "libraries": { + "12Interfaces/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/12Interfaces/bin/Debug/netcoreapp3.1/12Interfaces.dll b/12Interfaces/bin/Debug/netcoreapp3.1/12Interfaces.dll new file mode 100644 index 0000000000000000000000000000000000000000..fa7d94990cb4fddfe8a635c9ec02e5f23523bb55 Binary files /dev/null and b/12Interfaces/bin/Debug/netcoreapp3.1/12Interfaces.dll differ diff --git a/12Interfaces/bin/Debug/netcoreapp3.1/12Interfaces.exe b/12Interfaces/bin/Debug/netcoreapp3.1/12Interfaces.exe new file mode 100644 index 0000000000000000000000000000000000000000..f6f8e976941dfd85dd6e72a07ff21657425070c6 Binary files /dev/null and b/12Interfaces/bin/Debug/netcoreapp3.1/12Interfaces.exe differ diff --git a/12Interfaces/bin/Debug/netcoreapp3.1/12Interfaces.pdb b/12Interfaces/bin/Debug/netcoreapp3.1/12Interfaces.pdb new file mode 100644 index 0000000000000000000000000000000000000000..6a054d986c22e0c8d02b87e1f5bcbcc4029f4306 Binary files /dev/null and b/12Interfaces/bin/Debug/netcoreapp3.1/12Interfaces.pdb differ diff --git a/12Interfaces/bin/Debug/netcoreapp3.1/12Interfaces.runtimeconfig.dev.json b/12Interfaces/bin/Debug/netcoreapp3.1/12Interfaces.runtimeconfig.dev.json new file mode 100644 index 0000000000000000000000000000000000000000..3becea41545888f98131d88ad51766e8ddde3bce --- /dev/null +++ b/12Interfaces/bin/Debug/netcoreapp3.1/12Interfaces.runtimeconfig.dev.json @@ -0,0 +1,8 @@ +{ + "runtimeOptions": { + "additionalProbingPaths": [ + "C:\\Users\\wienkop\\.dotnet\\store\\|arch|\\|tfm|", + "C:\\Users\\wienkop\\.nuget\\packages" + ] + } +} \ No newline at end of file diff --git a/12Interfaces/bin/Debug/netcoreapp3.1/12Interfaces.runtimeconfig.json b/12Interfaces/bin/Debug/netcoreapp3.1/12Interfaces.runtimeconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..bc456d7868bb54ec1809da30e339cd43f0a8a09c --- /dev/null +++ b/12Interfaces/bin/Debug/netcoreapp3.1/12Interfaces.runtimeconfig.json @@ -0,0 +1,9 @@ +{ + "runtimeOptions": { + "tfm": "netcoreapp3.1", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "3.1.0" + } + } +} \ No newline at end of file diff --git a/12Interfaces/obj/12Interfaces.csproj.nuget.dgspec.json b/12Interfaces/obj/12Interfaces.csproj.nuget.dgspec.json new file mode 100644 index 0000000000000000000000000000000000000000..a93adde82ec7f8baf80f114f38ad71da5413e3e5 --- /dev/null +++ b/12Interfaces/obj/12Interfaces.csproj.nuget.dgspec.json @@ -0,0 +1,60 @@ +{ + "format": 1, + "restore": { + "C:\\Users\\wienkop\\source\\repos\\prog2-ss2020-wienkop\\12Interfaces\\12Interfaces.csproj": {} + }, + "projects": { + "C:\\Users\\wienkop\\source\\repos\\prog2-ss2020-wienkop\\12Interfaces\\12Interfaces.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\wienkop\\source\\repos\\prog2-ss2020-wienkop\\12Interfaces\\12Interfaces.csproj", + "projectName": "12Interfaces", + "projectPath": "C:\\Users\\wienkop\\source\\repos\\prog2-ss2020-wienkop\\12Interfaces\\12Interfaces.csproj", + "packagesPath": "C:\\Users\\wienkop\\.nuget\\packages\\", + "outputPath": "C:\\Users\\wienkop\\source\\repos\\prog2-ss2020-wienkop\\12Interfaces\\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 diff --git a/12Interfaces/obj/12Interfaces.csproj.nuget.g.props b/12Interfaces/obj/12Interfaces.csproj.nuget.g.props new file mode 100644 index 0000000000000000000000000000000000000000..71e2560680d6cba0b1c8f0e4f5c188f730659b86 --- /dev/null +++ b/12Interfaces/obj/12Interfaces.csproj.nuget.g.props @@ -0,0 +1,15 @@ +<?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 diff --git a/12Interfaces/obj/12Interfaces.csproj.nuget.g.targets b/12Interfaces/obj/12Interfaces.csproj.nuget.g.targets new file mode 100644 index 0000000000000000000000000000000000000000..53cfaa19b16f3769b2bfc33db3b5c0053c16fdba --- /dev/null +++ b/12Interfaces/obj/12Interfaces.csproj.nuget.g.targets @@ -0,0 +1,6 @@ +<?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 diff --git a/12Interfaces/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs b/12Interfaces/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs new file mode 100644 index 0000000000000000000000000000000000000000..ad8dfe1a6310302587a2d0c0111d81b250eb4105 --- /dev/null +++ b/12Interfaces/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// <autogenerated /> +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v3.1", FrameworkDisplayName = "")] diff --git a/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.AssemblyInfo.cs b/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.AssemblyInfo.cs new file mode 100644 index 0000000000000000000000000000000000000000..d9618af03182e54e264d3f7dd501f8d85589f9ce --- /dev/null +++ b/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.AssemblyInfo.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// <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("12Interfaces")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyProductAttribute("12Interfaces")] +[assembly: System.Reflection.AssemblyTitleAttribute("12Interfaces")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Von der MSBuild WriteCodeFragment-Klasse generiert. + diff --git a/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.AssemblyInfoInputs.cache b/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.AssemblyInfoInputs.cache new file mode 100644 index 0000000000000000000000000000000000000000..7bc2c5c727a454b83009f5ebf25ed607b3e51b49 --- /dev/null +++ b/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +0d518d1b0aa5b35c4c3caf828f1ca242de3b667f diff --git a/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.assets.cache b/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.assets.cache new file mode 100644 index 0000000000000000000000000000000000000000..946dde0f5e3fe4411ec9a0291617cbcd42223f73 Binary files /dev/null and b/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.assets.cache differ diff --git a/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.csproj.CoreCompileInputs.cache b/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000000000000000000000000000000000000..a6208805458adce2c76fe1cb8a7bcf642675c30b --- /dev/null +++ b/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +ac21ca68dcb5d4ef2cd250a94e0486d667df985e diff --git a/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.csproj.FileListAbsolute.txt b/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.csproj.FileListAbsolute.txt new file mode 100644 index 0000000000000000000000000000000000000000..b05a0bb5e8842271634dbc020b9555a7f48c320f --- /dev/null +++ b/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.csproj.FileListAbsolute.txt @@ -0,0 +1,12 @@ +C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\12Interfaces\bin\Debug\netcoreapp3.1\12Interfaces.exe +C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\12Interfaces\bin\Debug\netcoreapp3.1\12Interfaces.deps.json +C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\12Interfaces\bin\Debug\netcoreapp3.1\12Interfaces.runtimeconfig.json +C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\12Interfaces\bin\Debug\netcoreapp3.1\12Interfaces.runtimeconfig.dev.json +C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\12Interfaces\bin\Debug\netcoreapp3.1\12Interfaces.dll +C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\12Interfaces\bin\Debug\netcoreapp3.1\12Interfaces.pdb +C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\12Interfaces\obj\Debug\netcoreapp3.1\12Interfaces.AssemblyInfoInputs.cache +C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\12Interfaces\obj\Debug\netcoreapp3.1\12Interfaces.AssemblyInfo.cs +C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\12Interfaces\obj\Debug\netcoreapp3.1\12Interfaces.csproj.CoreCompileInputs.cache +C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\12Interfaces\obj\Debug\netcoreapp3.1\12Interfaces.dll +C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\12Interfaces\obj\Debug\netcoreapp3.1\12Interfaces.pdb +C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\12Interfaces\obj\Debug\netcoreapp3.1\12Interfaces.genruntimeconfig.cache diff --git a/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.dll b/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.dll new file mode 100644 index 0000000000000000000000000000000000000000..fa7d94990cb4fddfe8a635c9ec02e5f23523bb55 Binary files /dev/null and b/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.dll differ diff --git a/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.exe b/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.exe new file mode 100644 index 0000000000000000000000000000000000000000..f6f8e976941dfd85dd6e72a07ff21657425070c6 Binary files /dev/null and b/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.exe differ diff --git a/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.genruntimeconfig.cache b/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.genruntimeconfig.cache new file mode 100644 index 0000000000000000000000000000000000000000..34bedab819ef1631d37d6e87ef9a716c545a105e --- /dev/null +++ b/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.genruntimeconfig.cache @@ -0,0 +1 @@ +86c8e15dd33445635927cfaf398408205fd11473 diff --git a/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.pdb b/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.pdb new file mode 100644 index 0000000000000000000000000000000000000000..6a054d986c22e0c8d02b87e1f5bcbcc4029f4306 Binary files /dev/null and b/12Interfaces/obj/Debug/netcoreapp3.1/12Interfaces.pdb differ diff --git a/12Interfaces/obj/project.assets.json b/12Interfaces/obj/project.assets.json new file mode 100644 index 0000000000000000000000000000000000000000..31260b990ce4f86bf84cde8084837e88d2e7a9a2 --- /dev/null +++ b/12Interfaces/obj/project.assets.json @@ -0,0 +1,65 @@ +{ + "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\\12Interfaces\\12Interfaces.csproj", + "projectName": "12Interfaces", + "projectPath": "C:\\Users\\wienkop\\source\\repos\\prog2-ss2020-wienkop\\12Interfaces\\12Interfaces.csproj", + "packagesPath": "C:\\Users\\wienkop\\.nuget\\packages\\", + "outputPath": "C:\\Users\\wienkop\\source\\repos\\prog2-ss2020-wienkop\\12Interfaces\\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 diff --git a/12Interfaces/obj/project.nuget.cache b/12Interfaces/obj/project.nuget.cache new file mode 100644 index 0000000000000000000000000000000000000000..5d110d2f071711109a4d56c8e67b3a40bc9ed706 --- /dev/null +++ b/12Interfaces/obj/project.nuget.cache @@ -0,0 +1,8 @@ +{ + "version": 2, + "dgSpecHash": "ZwTv7qOuW3hJUkys8ho3nbAcqsZTMVjgqwwjOumRyOqYelzUfCtK5XtInr/b9BQXXyEvViTv8Bfzr+6nQaRnOg==", + "success": true, + "projectFilePath": "C:\\Users\\wienkop\\source\\repos\\prog2-ss2020-wienkop\\12Interfaces\\12Interfaces.csproj", + "expectedPackageFiles": [], + "logs": [] +} \ No newline at end of file diff --git a/12ToString/Program.cs b/12ToString/Program.cs index 50176ceb9edba27f46760276a8ce68fd96efaa03..4942e4c7d4c0f3ef26efe8e7da7a43ea4ad70eb5 100644 --- a/12ToString/Program.cs +++ b/12ToString/Program.cs @@ -1,10 +1,11 @@ using System; +using System.Security.Cryptography; namespace _12ToString { class Person { - string name, vorname; + public string name, vorname; public Person(string name, string vorname) { this.name = name; this.vorname = vorname; @@ -18,16 +19,46 @@ namespace _12ToString } class SpecPerson : Person { - public SpecPerson(string name, string vorname) : base(name, vorname) { } + int alter; + public SpecPerson(string name, string vorname, int alter) : base(name, vorname) { this.alter = alter; } public override string ToString() => $"(SpecPerson) {base.ToString()}"; + public void TueEtwas() { } + //public static explicit operator SpecPerson(Person p) + //{ + // return new SpecPerson(p.name, p.vorname, 20); + //} } + + class SuperSpecPerson : SpecPerson + { + public SuperSpecPerson(string name, string vorname, int alter) : base(name, vorname, alter) { } + public override string ToString() => $"(SpecSpecPerson) {base.ToString()}"; + } + class Program { + static void Main(string[] args) { - SpecPerson p1 = new SpecPerson("Meier", "Anton"); // p1: statischer Typ: SpecPerson, dynTyp: SpecPerson - Person p2 = p1; // p1: stat.Typ: Person, dyn.Typ: SpecPerson - // Jede SpecPerson ist eine Person! + SpecPerson p1 = new SpecPerson("Meier", "Anton", 10); // Objekt wird bei #100.000 angelegt + p1.TueEtwas(); + // p1: statischer Typ: SpecPerson, dynTyp: SpecPerson + // Statischer Typ bestimmt die zur Verfügung stehenden Methoden + // Dynamischer Typ bestimmt, welche Ausprägung (override) einer geerbten Methode genommen wird + + Person p2 = new SpecPerson("Meier", "Anton", 10); + + //Person p2 = p1; // p1: stat.Typ: Person, dyn.Typ: SpecPerson + // Jede SpecPerson ist eine Person! + + Person p3 = new Person("Huber","Berta"); + // p2.TueEtwas(); -- geht nicht, da die Klasse Person keine TueEtwas() Methode enthält + (p2 as SpecPerson).TueEtwas(); + + SpecPerson pp = (p3 as SpecPerson); // Konvertierung geht hier nicht, da p3 NUR eine Person (und keine + // SpecPerson ist; as liefert hier null zurück + pp?.TueEtwas(); + Console.WriteLine(p1); Console.WriteLine(p2); } diff --git a/12ToString/bin/Debug/netcoreapp3.1/12ToString.dll b/12ToString/bin/Debug/netcoreapp3.1/12ToString.dll index 95a27f5baf0c22cc4483b088cd597c08cd0589ba..0ffa6e2784acd35079440e449e88b1d1764b85b4 100644 Binary files a/12ToString/bin/Debug/netcoreapp3.1/12ToString.dll and b/12ToString/bin/Debug/netcoreapp3.1/12ToString.dll differ diff --git a/12ToString/bin/Debug/netcoreapp3.1/12ToString.pdb b/12ToString/bin/Debug/netcoreapp3.1/12ToString.pdb index dc05f459bab92b48da624fd5c836d48ed5798d9e..18be3dbcdbae69e4623505c58174e855b6829973 100644 Binary files a/12ToString/bin/Debug/netcoreapp3.1/12ToString.pdb and b/12ToString/bin/Debug/netcoreapp3.1/12ToString.pdb differ diff --git a/12ToString/obj/Debug/netcoreapp3.1/12ToString.csproj.FileListAbsolute.txt b/12ToString/obj/Debug/netcoreapp3.1/12ToString.csproj.FileListAbsolute.txt index 2f3f955bab8a8a89786aa792b962c1d03fcec60d..676934d3c99b676f5feba02c6cf3cfea9a98f9d5 100644 --- a/12ToString/obj/Debug/netcoreapp3.1/12ToString.csproj.FileListAbsolute.txt +++ b/12ToString/obj/Debug/netcoreapp3.1/12ToString.csproj.FileListAbsolute.txt @@ -10,3 +10,4 @@ C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\12ToString\obj\Debug\netcorea C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\12ToString\obj\Debug\netcoreapp3.1\12ToString.dll C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\12ToString\obj\Debug\netcoreapp3.1\12ToString.pdb C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\12ToString\obj\Debug\netcoreapp3.1\12ToString.genruntimeconfig.cache +C:\Users\wienkop\source\repos\prog2-ss2020-wienkop\12ToString\obj\Debug\netcoreapp3.1\12ToString.csprojAssemblyReference.cache diff --git a/12ToString/obj/Debug/netcoreapp3.1/12ToString.csprojAssemblyReference.cache b/12ToString/obj/Debug/netcoreapp3.1/12ToString.csprojAssemblyReference.cache new file mode 100644 index 0000000000000000000000000000000000000000..d7dd684443de8ada82f92a8e0cf14a64b9096fd6 Binary files /dev/null and b/12ToString/obj/Debug/netcoreapp3.1/12ToString.csprojAssemblyReference.cache differ diff --git a/12ToString/obj/Debug/netcoreapp3.1/12ToString.dll b/12ToString/obj/Debug/netcoreapp3.1/12ToString.dll index 95a27f5baf0c22cc4483b088cd597c08cd0589ba..0ffa6e2784acd35079440e449e88b1d1764b85b4 100644 Binary files a/12ToString/obj/Debug/netcoreapp3.1/12ToString.dll and b/12ToString/obj/Debug/netcoreapp3.1/12ToString.dll differ diff --git a/12ToString/obj/Debug/netcoreapp3.1/12ToString.pdb b/12ToString/obj/Debug/netcoreapp3.1/12ToString.pdb index dc05f459bab92b48da624fd5c836d48ed5798d9e..18be3dbcdbae69e4623505c58174e855b6829973 100644 Binary files a/12ToString/obj/Debug/netcoreapp3.1/12ToString.pdb and b/12ToString/obj/Debug/netcoreapp3.1/12ToString.pdb differ diff --git a/prog2-ss2020-wienkop.sln b/prog2-ss2020-wienkop.sln index 2f10c0f74feed84db46f37a03e53723e00ea8a38..69ac3e84ea75bbad4706da3f732ff424acf54e73 100644 --- a/prog2-ss2020-wienkop.sln +++ b/prog2-ss2020-wienkop.sln @@ -142,7 +142,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "11 UebgDiTransformator", "1 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "12Delegateaufrufausbreitung", "12Delegateaufrufausbreitung\12Delegateaufrufausbreitung.csproj", "{3235FAA2-2391-4A94-A574-57261E1AAB1D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "12ToString", "12ToString\12ToString.csproj", "{B54DE051-ED45-4A3B-9D57-907DD7BB7C81}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "12ToString", "12ToString\12ToString.csproj", "{B54DE051-ED45-4A3B-9D57-907DD7BB7C81}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "12Interfaces", "12Interfaces\12Interfaces.csproj", "{A4CE9D31-9638-47BF-AA34-D87E9FE3C8F7}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -422,6 +424,10 @@ Global {B54DE051-ED45-4A3B-9D57-907DD7BB7C81}.Debug|Any CPU.Build.0 = Debug|Any CPU {B54DE051-ED45-4A3B-9D57-907DD7BB7C81}.Release|Any CPU.ActiveCfg = Release|Any CPU {B54DE051-ED45-4A3B-9D57-907DD7BB7C81}.Release|Any CPU.Build.0 = Release|Any CPU + {A4CE9D31-9638-47BF-AA34-D87E9FE3C8F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4CE9D31-9638-47BF-AA34-D87E9FE3C8F7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4CE9D31-9638-47BF-AA34-D87E9FE3C8F7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4CE9D31-9638-47BF-AA34-D87E9FE3C8F7}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE