Beispiel #1
0
        public void Start()
        {
            if (!CanStart())
            {
                return;
            }
            var app = SelectedAppInfo;

            try
            {
                LauncherCoreViewModel.StartApp(app, () => Messenger.Raise(new InteractionMessage("Timeout")));
            }
            catch (Exception ex)
            {
                if (IsMaintenanceMode)
                {
                    Messenger.Raise(new InformationMessage(
                                        ex.Message + "\r\n\r\nファイルの配置とアクセス権限を確認して下さい。\r\nディレクトリ: " + app.Path + "\r\n実行ファイル相対パス: " + app.AppSpec.ExecutablePath,
                                        "エラー", MessageBoxImage.Error, "Information"));
                }
                else
                {
                    Messenger.Raise(new InformationMessage(ex.Message, "エラー", System.Windows.MessageBoxImage.Error, "Information"));
                }
            }
        }
Beispiel #2
0
        public async void Initialize()
        {
            IsLoading = true;
            await LauncherCoreViewModel.InitializeAsync();

            IsLoading = false;
        }
Beispiel #3
0
        public MainWindowViewModel()
        {
#if DEBUG
            if (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift))
            {
                IsMaintenanceMode = false;
            }
            else
            {
                IsMaintenanceMode = true;
            }
#else
            if (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift))
            {
                IsMaintenanceMode = true;
            }
            else
            {
                IsMaintenanceMode = false;
            }
#endif

            LauncherCoreViewModel = new LauncherCoreViewModel();
            CompositeDisposable.Add(new PropertyChangedEventListener(LauncherCoreViewModel, (sender, e) =>
            {
                if (e.PropertyName == "IsAppsEmpty")
                {
                    RaisePropertyChanged(nameof(IsVisibleNoSelectionText));
                }
            }));

            SourceCodeContentViewModel = new SourceCodeContentViewModel();
        }
        public SettingsWindowViewModel(LauncherCoreViewModel launcherCore)
        {
            launcherCoreViewModel = launcherCore;

            switch (launcherCore.SettingsViewModel.GlobalTimeLimitMode)
            {
            case Models.Settings.TimeLimitMode.Disabled:
                IsTimeLimitModeDisabled = true;
                break;

            case Models.Settings.TimeLimitMode.Default:
                IsTimeLimitModeDefault = true;
                break;

            case Models.Settings.TimeLimitMode.Enabled:
                IsTimeLimitModeEnabled = true;
                break;

            case Models.Settings.TimeLimitMode.Forced:
                IsTimeLimitModeForced = true;
                break;
            }

            GlobalTimeLimitMinutes = launcherCore.SettingsViewModel.GlobalTimeLimit.Minutes;
            GlobalTimeLimitSeconds = launcherCore.SettingsViewModel.GlobalTimeLimit.Seconds;
        }
Beispiel #5
0
        public void ClearCount()
        {
            var msg = new ConfirmationMessage("開始回数データをすべて消去します。よろしいですか?", "警告", System.Windows.MessageBoxImage.Warning, System.Windows.MessageBoxButton.YesNo, "Confirmation");

            Messenger.Raise(msg);
            if (msg.Response ?? false)
            {
                LauncherCoreViewModel.ClearCount();
                Initialize();
            }
        }
Beispiel #6
0
        public async void ExportApplicationId(SavingFileSelectionMessage parameter)
        {
            if (parameter.Response != null && parameter.Response.Count() == 1)
            {
                try
                {
                    await LauncherCoreViewModel.ExportApplicationIdAsync(parameter.Response[0]);

                    Messenger.Raise(new InformationMessage("データが保存されました。", "アプリケーション ID リストをエクスポート", System.Windows.MessageBoxImage.Information, "Information"));
                }
                catch (Exception ex)
                {
                    Messenger.Raise(new InformationMessage(ex.Message, "エラー", System.Windows.MessageBoxImage.Error, "Information"));
                }
            }
        }