Esempio n. 1
0
        static void Main(string[] args)
        {
            Invoker invoker = new Invoker();

            FilterParameters    filterParameters     = new FilterParameters();
            GetFilterParameters getFilterParameteres = new GetFilterParameters(filterParameters);

            invoker.SetCommand(getFilterParameteres);
            invoker.Run();

            CarsCatalog       carsCatalog       = new CarsCatalog();
            CreateCarsCatalog createCarsCatalog = new CreateCarsCatalog(carsCatalog);

            invoker.SetCommand(createCarsCatalog);
            invoker.Run();

            JavaScriptSerializer ser = new JavaScriptSerializer();
            string catalog           = ser.Serialize(carsCatalog.Catalog());

            File.WriteAllText("Cars catalog.json", catalog);
        }
Esempio n. 2
0
 /// <summary>
 /// Execute method which returns cars catalog
 /// </summary>
 public void Execute()
 {
     carsCatalog.Catalog();
 }