public ItemSearch(string name, ISearchEngine searchEngine, Price maximumBuyout, bool autoWhisper, bool ignoreNoBuyout) { Name = name; SearchEngine = searchEngine; MaximumBuyout = maximumBuyout; AutoWhisper = autoWhisper; IgnoreNoBuyout = ignoreNoBuyout; SearchEngine.OfferedItemFound += item => { if (Configuration.Current.ItemConfiguration.SeenItemIds.Contains(item.Id)) { return; } Configuration.Current.ItemConfiguration.SeenItemIds.Add(item.Id); if (IgnoreNoBuyout && item.Buyout.IsEmpty()) { return; } if (item.Buyout.IsEmpty() || item.Buyout.ApproximateValue <= MaximumBuyout.ApproximateValue) { ItemFound?.Invoke(this, item); } }; }
public List <string> Search(string path) { if (string.IsNullOrEmpty(path)) { throw new ArgumentException("path to directory is not valid"); } SearchStarted?.Invoke(); var items = new List <string>(); try { foreach (var item in GetFiles(path)) { var itemFoundArgs = new ItemFoundArgs(item); if (Filter(item)) { FilteredItemFound?.Invoke(this, itemFoundArgs); } else { ItemFound?.Invoke(this, itemFoundArgs); } if (itemFoundArgs.RemoveItemFromResult && itemFoundArgs.EndSearch) { break; } if (itemFoundArgs.RemoveItemFromResult) { continue; } items.Add(item); if (itemFoundArgs.EndSearch) { break; } } return(items); } finally { SearchFinished?.Invoke(); } }
private void OnItemFound(SearchResult item) { ItemFound?.Invoke(this, new ItemFoundEventArgs(item)); }
private void Provider_ItemFound(object sender, ItemFoundEventArgs e) { numItemsFound++; ItemFound?.Invoke(sender, e); }
protected virtual void OnItemFound(ItemFoundEventArgs e) { //Report Find results ItemFound?.Invoke(this, e); }
public void TriggerItemFound(long player, long item, int quantity) { ItemFound?.Invoke(player, item, quantity); }