static void Main(string[] args) { db = new DataBase <string>(); UserOfCurrentSession = new User <string>(); stateHandler += ShowMessage; colorStateHandler += ColorMessage; SearchProductsEvent += GetSearchedList; LogInEvent += Login; RegInEvent += Register; UserActionHandlerEvent += HandleUserAction; NewOfferEvent += AddNewOffer; Introducing(); }
/// <summary> /// Starts the specified loops. /// </summary> /// <param name="loops">The loops.</param> /// <exception cref="System.ArgumentException"> /// Number of loops must be grater than 0</exception> public void Start(int loops) { if (loops <= 0) { throw new ArgumentException("Number of loops must be grater than 0"); } ColorStateHandler csh = StartRedColor; csh += StartGreenColor; csh += StartYellowColor; while (loops-- >= 0) { csh.Invoke(); } }