diff --git a/Aufgabe3/ConsoleApplication1/Buffer.cs b/Aufgabe3/ConsoleApplication1/Buffer.cs index cb5d1bce6dc66385bee08b9278ef5b14f592bb80..bdae2616f7c92e91d34f0cf8990dd416d4ec55b5 100644 --- a/Aufgabe3/ConsoleApplication1/Buffer.cs +++ b/Aufgabe3/ConsoleApplication1/Buffer.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Threading; namespace ConsoleApplication1 @@ -8,7 +9,7 @@ namespace ConsoleApplication1 /// Creating a Class Buffer that contains a Queue that represent the "Parking lot". /// The Queue is limited by the size that can manually be setted /// </summary> - + public class Buffer { private Queue<Car> carQueue; diff --git a/Aufgabe3/ConsoleApplication1/Consumer.cs b/Aufgabe3/ConsoleApplication1/Consumer.cs index 334c90ef4af0c323c90f98dbb787486d9535e8f4..d79fa9c26d8bc2b7f10ff7ae4964f229bff6df26 100644 --- a/Aufgabe3/ConsoleApplication1/Consumer.cs +++ b/Aufgabe3/ConsoleApplication1/Consumer.cs @@ -1,7 +1,8 @@ using System; -using System.Runtime.CompilerServices; +using System.Runtime.ConstrainedExecution; using System.Threading; + namespace ConsoleApplication1 { public class Consumer @@ -16,7 +17,7 @@ namespace ConsoleApplication1 _buffer = buffer; _random = new Random(); } - + public void Consume() { while (true) diff --git a/Aufgabe3/ConsoleApplication1/Program.cs b/Aufgabe3/ConsoleApplication1/Program.cs index 459093b0be3d08322be247aad4611a2c743867dd..4a8afbad345ad3e7c1d1aeaea4cfbd79863e53ce 100644 --- a/Aufgabe3/ConsoleApplication1/Program.cs +++ b/Aufgabe3/ConsoleApplication1/Program.cs @@ -1,5 +1,7 @@ using System; using System.Collections.Generic; +using System.Net.Mime; +using System.Runtime.CompilerServices; using System.Runtime.Remoting.Messaging; using System.Threading; @@ -12,10 +14,24 @@ namespace ConsoleApplication1 { public static void Main(string[] args) { + + int nrProd = 0; + int nrCons = 0; - //Parse received program arguments to ints - int nrProd = int.Parse(args[0]); - int nrCons = int.Parse(args[1]); + //Parse received program arguments to int + try + { + nrProd = int.Parse(args[0]); + nrCons = int.Parse(args[1]); + } + catch (FormatException ignored) + { + Console.WriteLine("Please provide two positive integers as program arguments"); + Environment.Exit(1); + } + + + Buffer b = new Buffer(); diff --git a/Aufgabe3/ConsoleApplication1/bin/Debug/ConsoleApplication1.exe b/Aufgabe3/ConsoleApplication1/bin/Debug/ConsoleApplication1.exe index 2d94b58da8a0aeda545e423e7a64722e2abafce6..774de8d4f13bbf69d2c9d90bfab528e54ccd92be 100644 Binary files a/Aufgabe3/ConsoleApplication1/bin/Debug/ConsoleApplication1.exe and b/Aufgabe3/ConsoleApplication1/bin/Debug/ConsoleApplication1.exe differ diff --git a/Aufgabe3/ConsoleApplication1/bin/Debug/ConsoleApplication1.pdb b/Aufgabe3/ConsoleApplication1/bin/Debug/ConsoleApplication1.pdb index 3aad640ed3657cecdd96eeae8fb2d954b5243d86..cc3427a8e02ea48332d80d114b47b4b4aa19d210 100644 Binary files a/Aufgabe3/ConsoleApplication1/bin/Debug/ConsoleApplication1.pdb and b/Aufgabe3/ConsoleApplication1/bin/Debug/ConsoleApplication1.pdb differ diff --git a/Aufgabe3/ConsoleApplication1/obj/Debug/ConsoleApplication1.exe b/Aufgabe3/ConsoleApplication1/obj/Debug/ConsoleApplication1.exe index 2d94b58da8a0aeda545e423e7a64722e2abafce6..774de8d4f13bbf69d2c9d90bfab528e54ccd92be 100644 Binary files a/Aufgabe3/ConsoleApplication1/obj/Debug/ConsoleApplication1.exe and b/Aufgabe3/ConsoleApplication1/obj/Debug/ConsoleApplication1.exe differ diff --git a/Aufgabe3/ConsoleApplication1/obj/Debug/ConsoleApplication1.pdb b/Aufgabe3/ConsoleApplication1/obj/Debug/ConsoleApplication1.pdb index 3aad640ed3657cecdd96eeae8fb2d954b5243d86..cc3427a8e02ea48332d80d114b47b4b4aa19d210 100644 Binary files a/Aufgabe3/ConsoleApplication1/obj/Debug/ConsoleApplication1.pdb and b/Aufgabe3/ConsoleApplication1/obj/Debug/ConsoleApplication1.pdb differ