public void ZoomOut() { if (HoverTimeout != null) { HoverTimeout.Clear(); } CurrentHoverLot.Value = null; }
public void Invoke(Callback callback) { if (ThreadTimeout != null) { ThreadTimeout.Clear(); } ; ThreadTimeout = GameThread.SetTimeout(callback, Timeout); }
private void Price_OnChange(UIElement element) { var input = (UITextEdit)element; var price = input.CurrentText; var isValid = VMEODRackOwnerPlugin.PRICE_VALIDATION.IsMatch(price); if (!isValid) { //TODO: Text box does not seem to like been updated in the update event loop, fix this return; /*for (var i = 0; i < price.Length; i++) { * if (!Char.IsDigit(price[i])) { * price = price.Substring(i, 1); * i--; * } * } * * if (price.Length == 0) { price = "1"; } * if (price[0] == '0') { * price = "1" + price.Substring(1); * } * * input.CurrentText = price;*/ } //Mark as dirty var newSalePrice = -1; if (!int.TryParse(price, out newSalePrice)) { return; } var buttonIndex = Array.IndexOf(OutfitPrices, input); if (buttonIndex == -1) { return; } var priceIndex = GetPriceIndex(buttonIndex); if (priceIndex == -1) { return; } var outfit = Stock[priceIndex]; //Which outfit is this for? lock (DirtyPrices) { DirtyPrices[outfit.outfit_id] = newSalePrice; } if (DirtyTimeout != null) { DirtyTimeout.Clear(); } DirtyTimeout = GameThread.SetTimeout(() => FlushDirtyPrices(), 2000); }