public static void Run() { char key; while (true) { printMenu(); key = Console.ReadKey().KeyChar; Console.WriteLine(); switch (key) { case 's': SingleResponsibility_Report.Display(); Console.WriteLine("--------"); SingleResponsibility_MobileStore.Display(); break; case 'o': OpenClosed.Display(); Console.WriteLine("--------"); OpenClosed_TemplateMethod.Display(); break; case 'l': LiskovSubstitutionProblem_Rectangle.Display(); LiskovSubstitutionProblem_Precondition.Display(); LiskovSubstitutionProblem_Postcondition.Display(); LiskovSubstitutionProblem_Invariant.Display(); break; case 'i': InterfaceSegregation_Message.Display(); InterfaceSegregation_Photo.Display(); break; case 'd': DependencyInversion.Display(); break; case 'x': return; } Console.ReadKey(); } }
static void Main(string[] args) { var singleResponsibility = new SingleResponsibility(); singleResponsibility.Run(); var openClosed = new OpenClosed(); openClosed.Run(); var liskovSubstitution = new LiskovSubstitution(); liskovSubstitution.Run(); var interfaceSegregation = new InterfaceSegregation(); interfaceSegregation.Run(); var dependencyInjection = new DependencyInversion(); dependencyInjection.Run(); }