/// <summary> /// プリセットの削除 /// </summary> public async void Delete() { if (CurrentPreset == null) { return; } await ConfigJsonService.DeletePresetAsync(CurrentPreset.Id); }
/// <summary> /// プリセットのロード /// </summary> public async void LoadPreset() { if (SelectedPreset == null) { return; } await ConfigJsonService.LoadPresetAsync(SelectedPreset.Id); SelectedPreset = null; }
/// <summary> /// 新規プリセット保存 /// </summary> public async void SaveAs() { var dlgVm = new NewPresetDialogViewModel(); Messenger.Raise(new TransitionMessage(dlgVm, "NewPresetDialog")); if (dlgVm.IsOk) { await ConfigJsonService.SaveNewPresetAsync(dlgVm.PresetName); } }
/// <summary> /// JSONファイルのインポート /// </summary> private async void ImportJson() { var message = new OpeningFileSelectionMessage("ImportJsonFileDialog") { Title = Resources.ImportJsonFileDialogTitle, Filter = Resources.FileDialogJsonFilter, }; var result = Messenger.GetResponse(message); var path = result?.Response?.FirstOrDefault(); if (!string.IsNullOrWhiteSpace(path)) { await ConfigJsonService.ImportJsonAsync(path); } }
public void Setup() { settingService = new UserSettingServiceStub(); appSettings = (AppSettingsStub)settingService.AppSettings; fileService = new ConfigJsonFileServiceStub(); target = new ConfigJsonService(settingService, fileService); target.ConfigJson.IsChanged = true; var obj = new PrivateObject(target); obj.SetProperty(nameof(ConfigJsonService.CurrentPreset), new PresetInfo() { Id = "300" }); notifiedProperies = new List <string>(); target.PropertyChanged += (_, e) => notifiedProperies.Add(e.PropertyName); errorEvent = null; target.ErrorOccurred += (_, e) => errorEvent = e; }
/// <summary> /// 初期化処理 /// </summary> public async void Initialize() { await ConfigJsonService.ReadConfigJsonAsync(); }
/// <summary> /// config.jsonを更新してバーチャルキャスト起動 /// </summary> public async void RunVirtualCast() { await ConfigJsonService.WriteToConfigJsonAsync(); ExecutionService.RunVirtualCast(); }
/// <summary> /// config.json更新 /// </summary> public async void UpdateConfigJson() { await ConfigJsonService.WriteToConfigJsonAsync(); }
/// <summary> /// config.json読み込み /// </summary> public async void ReadConfigJson() { await ConfigJsonService.ReadConfigJsonAsync(); }