Exemple #1
0
        static void Main(string[] args)
        {
            var collection = new ComponentCollection();

            collection.AddItem(new Component()
            {
                Name = "Mainboard", Description = "Intel", Price = 2400
            });
            collection.AddItem(new Component()
            {
                Name = "Processor", Description = "Intel", Price = 3600
            });
            collection.AddItem(new Component()
            {
                Name = "VideoCard", Description = "nVidia", Price = 4000
            });
            collection.AddItem(new Component()
            {
                Name = "VideoCard", Description = "AMD", Price = 4500
            });
            collection.AddItem(new Component()
            {
                Name = "Processor", Description = "AMD", Price = 3000
            });
            Client  client  = new Client();
            Manager manager = new Manager(client, collection);

            manager.Execute();
        }
        public Stock(ComponentCollection collection, bool reverse = false)
        {
            this._collection = collection;
            this._reverse    = reverse;

            if (reverse)
            {
                this._position = collection.getItems().Count;
            }
        }
Exemple #3
0
 public Manager(Client client, ComponentCollection collection)
 {
     _client     = client;
     _collection = collection;
 }