This repository has been archived on 2020-04-03. You can view files and clone it, but cannot push or open issues or pull requests.
2017-07-05 14:14:54 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2017-07-05 15:17:43 +02:00
|
|
|
|
using System.Security.Policy;
|
2017-07-05 14:14:54 +02:00
|
|
|
|
|
|
|
|
|
namespace se_12_log_entry
|
|
|
|
|
{
|
|
|
|
|
internal class Program
|
|
|
|
|
{
|
|
|
|
|
public static void Main(string[] args)
|
|
|
|
|
{
|
2017-07-05 15:17:43 +02:00
|
|
|
|
Stack<LogEntry> logEntries = new Stack<LogEntry>();
|
2017-07-05 15:20:17 +02:00
|
|
|
|
int idCounter = 0;
|
|
|
|
|
while (idCounter < 11)
|
2017-07-05 15:17:43 +02:00
|
|
|
|
{
|
2017-07-05 15:20:17 +02:00
|
|
|
|
logEntries.Push(new LogEntry(idCounter, DateTime.Now));
|
|
|
|
|
idCounter++;
|
2017-07-05 15:17:43 +02:00
|
|
|
|
|
|
|
|
|
LogEntry newestEntry = logEntries.Peek();
|
|
|
|
|
Console.WriteLine("ID:"
|
|
|
|
|
+ newestEntry.ID
|
|
|
|
|
+ " Date:"
|
|
|
|
|
+ newestEntry.Date);
|
|
|
|
|
System.Threading.Thread.Sleep(2000);
|
|
|
|
|
}
|
2017-07-05 14:14:54 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-07-05 15:17:43 +02:00
|
|
|
|
}
|