source/Helpers/POETradeAPI/Exchange/ExchangePrefetch.cs
/// <summary>Translates an item's full name into the id used by the exchange API.
/// For instance, "Orb of Fusing" is converted to "fuse".</summary>
Translates an item's full name into the id used by the exchange API.
For instance, "Orb of Fusing" is converted to "fuse".
Translates an item ' s full name into the id used by the exchange API . For instance " Orb of Fusing " is converted to " fuse " .
private static async Task<string> TranslateItemName(Item item)
        {
            if (_nameToIdMap == null)
            {
                var uri = new Uri("Resources/ExchangeItemIds.json", UriKind.Relative);
                var resource = System.Windows.Application.GetContentStream(uri);
                using (var reader = new StreamReader(resource.Stream))
                {
                    var text = await reader.ReadToEndAsync();
                    _nameToIdMap = JsonConvert.DeserializeObject<Dictionary<string, string>>(text);
                }
            }
            return _nameToIdMap[item.Name];
        }
private static async Task < string > TranslateItemName ( Item item ) { if ( _nameToIdMap == null ) { var uri = new Uri ( " " , UriKind . Relative ) ; var resource = System . Windows . Application . GetContentStream ( uri ) ; using ( var reader = new StreamReader ( resource . Stream ) ) { var text = await reader . ReadToEndAsync ( ) ; _nameToIdMap = JsonConvert . DeserializeObject < Dictionary < string , string > > ( text ) ; } } return _nameToIdMap [ item . Name ] ; }
Translates an item's full name into the id used by the exchange API.
Translates an item ' s full name into the id used by the exchange API .
item
Item