private static void OnApplicationExit(object sender, EventArgs e) { TrayIcon.Dispose(); TradeClient.Dispose(); EventsHandler.Dispose(); OverlayController.Dispose(); }
/// <summary> /// Every item should start with Rarity in the first line. /// This will force the TradeClient to refetch the Public API's data if needed. /// </summary> public static async Task <bool> FindAndSetLanguageProvider(string itemDescription) { foreach (var item in RarityToLanguageDictionary) { if (itemDescription.Contains(item.Key)) { if (CurrentLanguage != item.Value) { Logger.Log($"Changed language support to {item.Value}."); CurrentLanguage = item.Value; Provider = GetLanguageProvider(item.Value); TradeClient.Dispose(); return(await TradeClient.Initialize()); } return(true); } } Logger.Log("This Path of Exile language is not yet supported."); return(false); }