private void button3_Click_1(object sender, EventArgs e) { //Buggy? int sel = 0; if (isFirstTab) { sel = scanListView.SelectedIndices[0]; var tocopy = new MainScanItem(new saveTab(scanItems[sel].Steam.scanInput), steam_srch.cookieCont, new eventDelegate(Event_Message), settings.ignoreWarn, settings.resellDelay); tocopy.Steam.scanInput.Name += " Copy"; scanItems.Insert(sel + 1, tocopy); scanListView.Items.Insert(sel, (ListViewItem)scanListView.Items[sel].Clone()); scanListView.Items[sel + 1].SubItems[1].Text = tocopy.Steam.scanInput.Name; SetColumnWidths(scanListView, true); scanItems.UpdateIds(); BindToControls(scanListView); } else { sel = recentListView.SelectedIndices[0]; var tocopy = new saveTab(steam_srch.recentInputList[sel]); tocopy.Name += " Copy"; steam_srch.recentInputList.Insert(sel + 1, tocopy); recentListView.Items.Insert(sel, (ListViewItem)recentListView.Items[sel].Clone()); recentListView.Items[sel + 1].SubItems[1].Text = tocopy.Name; SetColumnWidths(recentListView, true); BindToControls(recentListView); } }
private void addScanItem(SteamSite.SearchItem ourItem, int delay, int buyQuant, bool tobuy, int resellType, status Stat) { string[] row = { string.Empty, ourItem.Name, ourItem.StartPrice }; var lstItem = new ListViewItem(row); scanListView.Items.Add(lstItem); var ourTab = new saveTab(ourItem.Name, ourItem.Link, ourItem.ImgLink, ourItem.StartPrice, delay, buyQuant, tobuy, resellType, ourItem.StartPrice, Stat); scanItems.Add(new MainScanItem(ourTab, steam_srch.cookieCont, new eventDelegate(Event_Message), settings.ignoreWarn, settings.resellDelay)); setStatImg(scanListView.Items.Count - 1, (status)Convert.ToByte(!isScanValid(ourTab, true)), scanListView); SetColumnWidths(scanListView, true); }
private void addRecentItem(SteamSite.SearchItem ourItem, status Stat) { string[] row = { string.Empty, ourItem.Name, ourItem.StartPrice }; var lstItem = new ListViewItem(row); recentListView.Items.Add(lstItem); var ourTab = new saveTab(ourItem.Name, ourItem.Link, ourItem.ImgLink, ourItem.StartPrice, steam_srch.mainDelay, 0, false, 0, ourItem.StartPrice, Stat); steam_srch.recentInputList.Add(ourTab); setStatImg(recentListView.Items.Count - 1, (status)Convert.ToByte(!isScanValid(ourTab, false)), recentListView); SetColumnWidths(recentListView, true); }
private void recentListView_DragDrop(object sender, DragEventArgs e) { if (recentListView.SelectedItems.Count == 0) { return; } Point cp = recentListView.PointToClient(new Point(e.X, e.Y)); ListViewItem dragToItem = recentListView.GetItemAt(cp.X, cp.Y); if (dragToItem == null) { return; } int dragIndex = dragToItem.Index; ListViewItem[] sel = new ListViewItem[recentListView.SelectedItems.Count]; saveTab[] vsel = new saveTab[recentListView.SelectedItems.Count]; for (int i = 0; i < recentListView.SelectedItems.Count; i++) { sel[i] = recentListView.SelectedItems[i]; vsel[i] = steam_srch.recentInputList[recentListView.SelectedIndices[i]]; } for (int i = 0; i < sel.GetLength(0); i++) { ListViewItem dragItem = sel[i]; saveTab vdragItem = vsel[i]; int itemIndex = dragIndex; if (itemIndex == dragItem.Index) { return; } if (dragItem.Index < itemIndex) itemIndex++; else itemIndex = dragIndex + i; saveTab insertVItem = new saveTab(vdragItem); steam_srch.recentInputList.Insert(itemIndex, insertVItem); steam_srch.recentInputList.Remove(vdragItem); ListViewItem insertItem = (ListViewItem)dragItem.Clone(); recentListView.Items.Insert(itemIndex, insertItem); recentListView.Items.Remove(dragItem); insertItem.Selected = true; } }
public int BuyLogic(int wished, string sessid, ScanItem ourItem, saveTab Input, int buyCont, bool ismain) { int total = ourItem.Price + ourItem.Fee; string totalStr = total.ToString(); if (total <= wished) { if ((Input.ToBuy) && (Main.walletVal > Main.stopfundsVal)) { var buyresp = BuyItem(cookieCont, sessid, ourItem.ListringId, Input.Link, ourItem.Price.ToString(), ourItem.Fee.ToString(), totalStr); if (buyresp.Succsess) { //Resell if (Input.ResellType != 0) { StartResellThread(totalStr, Input.ResellPrice, ourItem.Type, ourItem.ItemName, Input.ResellType); } doMessage(flag.Success_buy, scanID, buyresp.Mess, ismain); doMessage(flag.Price_btext, scanID, totalStr, ismain); buyCont++; //Bloody hell, you're f****n' genious! if (buyCont == Input.BuyQnt) { Input.ToBuy = false; doMessage(flag.Send_cancel, scanID, string.Empty, ismain); } return buyCont; } else { doMessage(flag.Error_buy, scanID, buyresp.Mess, ismain); } } else doMessage(flag.Price_htext, scanID, totalStr, ismain); } else doMessage(flag.Price_text, scanID, totalStr, ismain); return buyCont; }
public void BuyLogic(int wished, string sessid, ScanItem ourItem, saveTab Input, int buyCont, bool ismain) { int total = ourItem.Price + ourItem.Fee; string totalStr = total.ToString(); string prtoTxt = DoFracture(totalStr); if (total < wished) { if (Input.ToBuy) { var buyresp = BuyItem(cookieCont, sessid, ourItem.ListringId, Input.Link, ourItem.Price.ToString(), ourItem.Fee.ToString(), totalStr); if (buyresp.Succsess) { //Resell if (Input.ResellType != 0) { StartResellThread(totalStr, Input.ResellPrice, ourItem.Type, ourItem.ItemName); } doMessage(flag.Success_buy, scanID, buyresp.Mess, ismain); doMessage(flag.Price_btext, scanID, prtoTxt, ismain); buyCont++; if (buyCont == Input.BuyQnt) { doMessage(flag.Send_cancel, scanID, string.Empty, ismain); } } else { doMessage(flag.Error_buy, scanID, buyresp.Mess, ismain); } } else doMessage(flag.Price_htext, scanID, prtoTxt, ismain); } else doMessage(flag.Price_text, scanID, prtoTxt, ismain); }