예제 #1
0
 /// <summary>
 /// プリセットの削除
 /// </summary>
 public async void Delete()
 {
     if (CurrentPreset == null)
     {
         return;
     }
     await ConfigJsonService.DeletePresetAsync(CurrentPreset.Id);
 }
예제 #2
0
        /// <summary>
        /// プリセットのロード
        /// </summary>
        public async void LoadPreset()
        {
            if (SelectedPreset == null)
            {
                return;
            }

            await ConfigJsonService.LoadPresetAsync(SelectedPreset.Id);

            SelectedPreset = null;
        }
예제 #3
0
        /// <summary>
        /// 新規プリセット保存
        /// </summary>
        public async void SaveAs()
        {
            var dlgVm = new NewPresetDialogViewModel();

            Messenger.Raise(new TransitionMessage(dlgVm, "NewPresetDialog"));

            if (dlgVm.IsOk)
            {
                await ConfigJsonService.SaveNewPresetAsync(dlgVm.PresetName);
            }
        }
예제 #4
0
        /// <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);
            }
        }
예제 #5
0
        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;
        }
예제 #6
0
 /// <summary>
 /// 初期化処理
 /// </summary>
 public async void Initialize()
 {
     await ConfigJsonService.ReadConfigJsonAsync();
 }
예제 #7
0
        /// <summary>
        /// config.jsonを更新してバーチャルキャスト起動
        /// </summary>
        public async void RunVirtualCast()
        {
            await ConfigJsonService.WriteToConfigJsonAsync();

            ExecutionService.RunVirtualCast();
        }
예제 #8
0
 /// <summary>
 /// config.json更新
 /// </summary>
 public async void UpdateConfigJson()
 {
     await ConfigJsonService.WriteToConfigJsonAsync();
 }
예제 #9
0
 /// <summary>
 /// config.json読み込み
 /// </summary>
 public async void ReadConfigJson()
 {
     await ConfigJsonService.ReadConfigJsonAsync();
 }