// För ni som vill använda själva loggern samt använda er av ett textbaserat UI (user interface) för t.ex val av olika typer av kameror // kan prova att implementera MVC pattern static void Main(string[] args) { //EXAMPLE // An instance of the monitor system CameraMonitor mon = new CameraMonitor(); // Create two outdoor cameras OutDoorCamera out1 = new OutDoorCamera(1); OutDoorCamera out2 = new OutDoorCamera(2); // Add them to the monitor mon.AttachCamera(out1); mon.AttachCamera(out2); // Just an optional scenario: // If time is night(20-07) - start the outdoor cameras TimeSpan start = TimeSpan.Parse("20:00"); TimeSpan end = TimeSpan.Parse("07:00"); TimeSpan now = DateTime.Now.TimeOfDay; if ((now > start) && (now < end)) { mon.StartCameras(); } else { mon.StopCameras(); } }
static void Main(string[] args) { // Print menu PrintMenu print = new PrintMenu(); Console.WriteLine(print.MenuItems()); Console.Write("Enter your selection: "); var choice = int.Parse(Console.ReadLine()); var camera = print.BuildMenu(choice); //print.TypeMenu(); // An instance of the monitor system CameraMonitor mon = new CameraMonitor(); // Add them to the monitor mon.AttachCamera(camera); // Start mon.StartCamera(); }