Esempio n. 1
0
        public void StartToWork()
        {
            this.SellerState = SellerState.Work;
            this.IsFree      = true;

            while (this.SellerState != SellerState.NotWork)
            {
                if (this.currentBuyer != null)
                {
                    Thread.Sleep(new Random().Next(300, 500));

                    lock (colorLocked)
                    {
                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine("Продавец возвратил стенду покупателя с id={0}", this.currentBuyer.ID);
                        Console.ForegroundColor = ConsoleColor.White;
                    }
                    if (this.ReturnCurrentBuyer != null)
                    {
                        this.ReturnCurrentBuyer(this, this.currentBuyer);
                        this.currentBuyer = null;
                    }
                    Thread.Sleep(200);
                }

                this.IsFree = true;
            }
        }
Esempio n. 2
0
 protected Seller(string mailAddress, string representativeName, string companyName, string companyAddress, SellerState state)
 {
     this.SellerId           = Guid.NewGuid();
     this.MailAddress        = mailAddress;
     this.representativeName = representativeName;
     this.companyName        = companyName;
     this.companyAddress     = companyAddress;
     this.State           = state;
     this.AdministratorId = null;
 }
Esempio n. 3
0
 public void NoMoreBuyers()
 {
     this.SellerState = SellerState.NotWork;
 }
Esempio n. 4
0
 public Seller()
 {
     this.currentBuyer = null;
     this.SellerState  = SellerState.NotWork;
     this.IsFree       = true;
 }