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; } }
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; }
public void NoMoreBuyers() { this.SellerState = SellerState.NotWork; }
public Seller() { this.currentBuyer = null; this.SellerState = SellerState.NotWork; this.IsFree = true; }