private void ButtonFetch_Click(object sender, RoutedEventArgs e)
        {
            if (base.UseAid)
            {
                var aid = TaskDialog.GetAid(textBoxAid.Text);
                if (aid != string.Empty)
                {
                    if (!int.TryParse(textBoxPart.Text.Trim(), out int page))
                    {
                        page = 1;
                    }
                    this.OnNewTaskRequested(aid, page);
                }
            }
            else
            {
                var url = textBoxUrl.Text.Trim();
                try
                {
                    this.OnNewTaskRequested(FetchingCore.GetTaskTokenFromUrl(url));
                }
                catch (Exception ex)
                {
                    base.OnErrorCaptured(ex);
                    return;
                }
            }

            this.Close();
        }
コード例 #2
0
        private void buttonStart_Click(object sender, RoutedEventArgs e)
        {
            int partStart, partEnd;

            if (!int.TryParse(tbPartStart.Text.Trim(), out partStart))
            {
                partStart = 1;
            }
            if (!int.TryParse(tbPartEnd.Text.Trim(), out partEnd))
            {
                partEnd = int.MaxValue;
            }

            string aid = null;

            if ((bool)cbUseAid.IsChecked)
            {
                aid = TaskDialog.GetAid(textBoxAid.Text);
                if (aid != string.Empty)
                {
                    this.OnNewMultiTaskRequested(aid, partStart, partEnd);
                }
            }
            else
            {
                var url = tbUrl.Text.Trim();
                try
                {
                    var token = FetchingCore.GetTaskTokenFromUrl(url);
                    this.OnNewMultiTaskRequested(token.Aid, partStart, partEnd);
                }
                catch (Exception ex)
                {
                    base.OnErrorCaptured(ex);
                    return;
                }
            }

            Close();
        }
コード例 #3
0
 private void Dialog_NewMultiTaskRequested(object sender, NewMultiTaskRequestEventArgs e)
 {
     FetchingCore.NewMultiTask(e.Aid, e.Start, e.End);
 }
コード例 #4
0
 private void Dialog_NewTaskRequested(object sender, Process.NewTaskRequestEventArgs e)
 {
     FetchingCore.CreateTask(e.Token);
 }