Exemplo n.º 1
0
            static void Main()
            {
                try
                {
                    Console.WriteLine("Starting test . .\n");//тестируем . .
                    Register register = new Register("Test register");
                    register.AddTrigger(new TriggerRS());
                    register.AddTrigger(new TriggerJK());
                    register.AddTrigger(new TriggerRS());
                    register.GetTriggersState();
                    foreach (Trigger t in register)
                    {
                        if (t is TriggerRS)
                        {
                            TriggerRS temp = (TriggerRS)t;
                            temp.GiveSignaltoSinput();
                        }
                        if (t is TriggerJK)
                        {
                            TriggerJK temp = (TriggerJK)t;
                            temp.GiveSignaltoJinput();
                        }
                    }
                    register.GetTriggersState();
                    register.DeleteTrigger(1);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                    Console.ReadLine();
                    return;
                }

                Console.ReadLine();
            }