Beispiel #1
0
        private void OnStartCrawling(object sender, EventArgs e)
        {
            if (CreateInput())
            {
                m_start_button.IsEnabled = false;

                m_stop_button.IsEnabled = true;

                int id = InputData.CrawlingStartId;

                int?endId = InputData.CreateNullInt32(InputData.CrawlingEndId);

                int?maxExCount = InputData.CreateNullInt32(InputData.CrawlingMaxExCount);

                int taskCount = InputData.TaskCount;

                var moed = GetCrawlingMoedValue(m_crawling_mode_picker.SelectedItem.ToString());

                m_crawling = Crawling.Start(moed, maxExCount, id, endId, taskCount, new TimeSpan(0, 0, ConstInfo.CRAWLING_TIMEOUT));

                m_crawling.Task.ContinueWith((t) => MainThread.BeginInvokeOnMainThread(() => InitInputView()));
            }
            else
            {
                DisplayAlert("错误", "必须输入参数", "确定");
            }
        }