Beispiel #1
0
        public void TaskStart(object sender, RoutedEventArgs e)
        {
            try
            {
                if (IsEachTaskIdEmpty())
                {
                    CommonViewModel.NotifySystemMessage(GetLangMessage.GetMessage("Msg1001"));
                    return;
                }


                Msg = TimeInfoModel.RegisterStart(SelectedEachTaskId);
                if (Msg != null)
                {
                    CommonViewModel.NotifySystemMessage(Msg);

                    if (Msg != GetLangMessage.GetMessage("Msg1016"))
                    {
                        // If the button pushing is invalid, return and not update the status.
                        return;
                    }
                }

                if (ConfigModel.GetSpecificConfigValue(ConfigModel.ConfigType.NotificationFlag) == true.ToString())
                {
                    this.NotifyRestTime = ThreadPoolTimer.CreatePeriodicTimer((source) =>
                    {
                        Notification notification = new Notification();
                        notification.NotifyRestTime();
                    }, TimeSpan.FromMinutes(float.Parse(ConfigModel.GetSpecificConfigValue(ConfigModel.ConfigType.NotificationSpanMinute))));
                }

                // Update Recent status
                SetRecentInfo("Msg1010");
            }
            catch
            {
                CommonViewModel.NotifySystemMessage(GetLangMessage.GetMessage("Exception"));
            }
        }
Beispiel #2
0
        public void TaskStart(object sender, RoutedEventArgs e)
        {
            if (IsEachTaskIdEmpty())
            {
                NotifySystemMessage("タスクを選択してください");
                return;
            }

            Msg = TimeInfoModel.RegisterStart(SelectedEachTaskId);
            if (Msg != null)
            {
                NotifySystemMessage(Msg);
            }

            NotifyRestTime = ThreadPoolTimer.CreatePeriodicTimer((source) =>
            {
                Notification notification = new Notification();
                notification.NotifyRestTime();
            }, TimeSpan.FromMinutes(float.Parse(ConfigModel.GetSpecificConfigValue(ConfigModel.ConfigType.NotificationSpanMinute))));


            SetRecentInfo("実行中");
        }