public static void Commercial(ID3v2TagVersion tagVersion, bool useLogo) { if (tagVersion == ID3v2TagVersion.ID3v22) { throw new NotSupportedException(); } IID3v2Tag id3 = new ID3v2Tag(); ICommercial aud = id3.CommercialInfoList.AddNew(); using (MemoryStream ms = new MemoryStream()) { ms.WriteByte(0); // text encoding Write(ms, Encoding.ASCII.GetBytes("usd10.00/cad15.00")); ms.WriteByte(0); // terminate Write(ms, Encoding.ASCII.GetBytes("20070610")); Write(ms, Encoding.ASCII.GetBytes("www.google.com")); ms.WriteByte(0); // terminate ms.WriteByte((byte)ReceivedAs.FileOverTheInternet); Write(ms, Encoding.ASCII.GetBytes("name of seller")); ms.WriteByte(0); // terminate Write(ms, Encoding.ASCII.GetBytes("description")); ms.WriteByte(0); // terminate if (useLogo) { Write(ms, Encoding.ASCII.GetBytes("image/jpeg")); ms.WriteByte(0); // terminate Write(ms, new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04 }); } TestFrame(aud, tagVersion, ms.ToArray()); } }
public Note(DateTime dateNoteFrais, ICommercial c) { this.Rembourse = false; this.DateNoteFrais = dateNoteFrais; this.AgentCommercial = c; this.SetNoteInCommercial(); }
public bool PayForItem(ICommercial commercialItem) { if (this.Cash >= commercialItem.Price) { this.Cash -= commercialItem.Price; return(true); } else { throw new ArgumentException("You don't have enough money to by it."); } }
private void BuyItem(CommercialBuilding building, ICommercial item, Button button) { try { int currentCash = ninja.Cash; building.Sell(item, ninja); if (currentCash == ninja.Cash) { MessageBox.Show("You rich the maximum of items that you can hold (10 items per category)!"); } } catch (ArgumentException ex) { MessageBox.Show(ex.Message); } button.PerformClick(); }
public void Sell(ICommercial commercialItem, Ninja ninja) { // If ninja have enough money to pay, he pays if (ninja.PayForItem(commercialItem)) { // If ninja accepts the item he takes it if (ninja.GetItem(commercialItem as Item)) { int index = this.goods.IndexOf(commercialItem); this.goods.RemoveAt(index); var itemRecharge = commercialItem.Clone(); this.goods.Insert(index, itemRecharge as ICommercial); } else { // Return money ninja.GetCash(commercialItem.Price); } } }
public bool PayForItem(ICommercial commercialItem) { if (this.Cash >= commercialItem.Price) { this.Cash -= commercialItem.Price; return true; } else { throw new ArgumentException("You don't have enough money to by it."); } }
private void BuyItem(CommercialBuilding building, ICommercial item, Button button) { try { int currentCash = ninja.Cash; building.Sell(item, ninja); if(currentCash == ninja.Cash) { MessageBox.Show("You rich the maximum of items that you can hold (10 items per category)!"); } } catch (ArgumentException ex) { MessageBox.Show(ex.Message); } button.PerformClick(); }
public RepasMidi(DateTime date, ICommercial commercial, double amount) : base(date, commercial) { this.MealCost = amount; this.SetMontantARembourser(); }
public FraisTransport(DateTime date, ICommercial commercial, int distance) : base(date, commercial) { Distance = distance; this.SetMontantARembourser(); }
public void AjouterNote(ICommercial commercial, DateTime date, double amount, int region) { new FraisNuite(date, commercial, amount, region); }
public void AjouterNote(ICommercial commercial, DateTime date, double amount) { new RepasMidi(date, commercial, amount); }
public void AjouterNote(ICommercial commercial, DateTime date, int distance) { new FraisTransport(date, commercial, distance); }
public void AjouterCommercial(ICommercial commercial) { Commercials.Add(commercial); }
public FraisNuite(DateTime date, ICommercial commercial, double amount, int region) : base(date, commercial) { this.MealCost = amount; Region = region; this.SetMontantARembourser(); }