public void Migrate() { if (_appFlagsRepository.IsSearchQueryInPinsMigration_V_0_26_0) { return; } var pins = _pinSettings.ReadAllItems(); foreach (var pin in pins) { #pragma warning disable CS0612 // 型またはメンバーが旧型式です if (pin.PageType == Domain.PageNavigation.HohoemaPageType.SearchResultKeyword) { pin.PageType = Domain.PageNavigation.HohoemaPageType.Search; pin.Parameter = pin.Parameter + $"&service={SearchTarget.Keyword}"; _pinSettings.UpdateItem(pin); } else if (pin.PageType == Domain.PageNavigation.HohoemaPageType.SearchResultTag) { pin.PageType = Domain.PageNavigation.HohoemaPageType.Search; pin.Parameter = pin.Parameter + $"&service={SearchTarget.Tag}"; _pinSettings.UpdateItem(pin); } else if (pin.PageType == Domain.PageNavigation.HohoemaPageType.SearchResultLive) { pin.PageType = Domain.PageNavigation.HohoemaPageType.Search; pin.Parameter = pin.Parameter + $"&service={SearchTarget.Niconama}"; _pinSettings.UpdateItem(pin); } #pragma warning restore CS0612 // 型またはメンバーが旧型式です } _appFlagsRepository.IsSearchQueryInPinsMigration_V_0_26_0 = true; }
async void ExecuteOverridePinCommand(PinMenuItemViewModel item) { var currentMethod = System.Reflection.MethodBase.GetCurrentMethod(); //Microsoft.AppCenter.Analytics.Analytics.TrackEvent($"{currentMethod.DeclaringType.Name}#{currentMethod.Name}"); var pin = item.Pin; var name = pin.OverrideLabel ?? $"{pin.Label} ({pin.PageType.Translate()})"; var result = await _dialogService.GetTextAsync( $"RenameX".Translate(name), "PinRenameDialogPlacefolder_EmptyToDefault".Translate(), name, (s) => true ); pin.OverrideLabel = result; _pinSettings.UpdateItem(pin); }