public TradeSel(PZTrade tradee, string name) { InitializeComponent(); textBox1.Text = Settings.Default.DefSfstr; textBox2.Text = Settings.Default.DefBfstr; textBox3.Text = Settings.Default.DefNamefstr; textBox4.Text = name; LoadTrade(tradee); Upd(); }
public void LoadTrade(PZTrade t) { selling = t.selling; buying = t.buying; textBox2.Text = t.fbuying; textBox1.Text = t.fselling; textBox3.Text = t.fname; textBox4.Text = t.name; checkBox1.Checked = t.includename; textBox5.Text = t.GetMessage(); }
public void Upd() { UpdtListboxes(); trade = new PZTrade(); trade.selling = selling; trade.buying = buying; trade.fbuying = textBox2.Text; trade.fselling = textBox1.Text; trade.fname = textBox3.Text; trade.includename = checkBox1.Checked; trade.name = textBox4.Text; textBox5.Text = trade.GetMessage(); }
public void Input(PZItem input) { t = new PZTrade(); t.selling.Add(input); t.buying.Add(output); t.name = client.ToString(); client.tradequeue = new PZTrade[] { t }.ToList(); client.index = 0; client.enabled = true; client.spamenabled = true; doing = true; }
private void button1_Click(object sender, EventArgs e) { try { PZTrade temp = client.tradequeue[listBox1.SelectedIndex + 0]; client.tradequeue[listBox1.SelectedIndex + 0] = client.tradequeue[listBox1.SelectedIndex - 1]; client.tradequeue[listBox1.SelectedIndex - 1] = temp; UpdtListBox(); listBox1.SelectedIndex++; listBox1_SelectedIndexChanged(null, EventArgs.Empty); } catch { } }
public PZTrade CloneTrade(PZTrade input) { PZTrade ret = new PZTrade(); foreach (var item in input.buying) { ret.buying.Add(CloneItem(item)); } foreach (var item in input.selling) { ret.selling.Add(CloneItem(item)); } ret.fbuying = input.fbuying; ret.fname = input.fname; ret.fselling = input.fselling; ret.includename = input.includename; ret.name = input.name; Console.WriteLine(ret); return(ret); }
private void button1_Click(object sender, EventArgs e) { if (listBox1.SelectedIndex == -1) { return; } string txt = sects[listBox1.SelectedIndex].Value; MatchCollection trades = rgxtrade.Matches(txt); foreach (Match tr in trades) { PZTrade trade = new PZTrade(); string fsellr = rgxfsell.Match(tr.Value).Value; string fsell = fsellr.Substring(2, fsellr.Length - 4); trade.fselling = fsell; string before = rgxbefore.Match(tr.Value).Value; MatchCollection items = rgxitem.Matches(before); foreach (Match itemfdgsasdasdash in items) { string item = itemfdgsasdasdash.Value.Substring(2, itemfdgsasdasdash.Value.Length - 4); string[] s = item.Split('º'); PZItem pzitem = new PZItem(Int32.Parse(s[2]), Int32.Parse(s[0]), s[1]); trade.selling.Add(pzitem); } string fbuyr = rgxfbuy.Match(tr.Value).Value; string fbuy = fbuyr.Substring(1, fbuyr.Length - 2); trade.fbuying = fbuy; string after = rgxafter.Match(tr.Value).Value; items = rgxitem.Matches(after); foreach (Match itemfdgsasdasdash in items) { string item = itemfdgsasdasdash.Value.Substring(2, itemfdgsasdasdash.Value.Length - 4); string[] s = item.Split('º'); PZItem pzitem = new PZItem(Int32.Parse(s[2]), Int32.Parse(s[0]), s[1]); trade.buying.Add(pzitem); } string inc = rgxincnm.Match(tr.Value).Value; if (inc.StartsWith("f")) { trade.includename = false; } else { trade.includename = true; } string fnamer = rgxfname.Match(tr.Value).Value; string fname = fnamer.Substring(2, fnamer.Length - 4); trade.fname = fname; trade.name = clientname; Console.WriteLine(trade.ToString()); ltrades.Add(trade); } this.Close(); }