Пример #1
0
        public static async Task DownloadUIDataAndSaveInIndexedDB()
        {
            if (!LocalData.uiTranslator.TSUIWordNativesList.Any())
            {
                LocalData.uiTranslator.TSUIWordNativesList = await WebApiFunctions.CmdGetAllUIWordNatives();
            }

            LocalData.uiTranslator.PrepareDict(await WebApiFunctions.CmdGetAllUIWordForeigns(LocalData.uiTranslator.CurrUILanguage.ID));



            if (LocalData.UsingIndexedDb)
            {
                foreach (var item in LocalData.uiTranslator.TSUIWordsPairsList)
                {
                    var newRecord = new StoreRecord <TSUIWordsPair>
                    {
                        Storename = "UILangDict" + LocalData.uiTranslator.CurrUILanguage.Code,
                        Data      = item
                    };

                    await LocalData.indexedDbManager.AddRecord(newRecord);
                }
            }
        }