private void Initialize() { DictionaryInfo info = _parametersManager.Get <DictionaryInfo>(Parameters.LaunchedProduct); Uri fileUri = new Uri(string.Format(FileNameFormat, Data.FormatVersion, info.Id), UriKind.Relative); _dataAccessorV2 = new DataAccessorV2(fileUri); ReadData(); }
private async Task Convert(Uri fileUriV1, Uri fileUriV2) { DataAccessorV1 dataAccessorV1 = new DataAccessorV1(fileUriV1); List <DictionaryItem> itemsV1 = new List <DictionaryItem>(await dataAccessorV1.ReadData()); if (itemsV1.Count > 0) { DataAccessorV2 dataAccessorV2 = new DataAccessorV2(fileUriV2); List <DictionaryItem> itemsV2 = new List <DictionaryItem>(await dataAccessorV2.ReadData()); foreach (DictionaryItem itemV1 in itemsV1) { if (!itemsV2.Contains(itemV1)) { itemsV2.Add(itemV1); } } await dataAccessorV2.WriteData(itemsV2.OrderBy(i => i.Title).Select(i => i)); } await dataAccessorV1.DeleteFile(); }