Esempio n. 1
0
 public DownloadRequest(String searchQuery, String downloadPath, Boolean autoDownload, RequestImageType imageType = RequestImageType.Image)
 {
     SearchQuery  = DerpiAPI.CheckSearchRequest(searchQuery) ? searchQuery : String.Empty;
     DownloadPath = PathUtils.IsValidPath(downloadPath, PathType.File) ? downloadPath : Globals.CurrentDownloadPath;
     AutoDownload = autoDownload;
     ImageType    = imageType;
 }
Esempio n. 2
0
 private void OnTextChanged()
 {
     Replace(ReplaceDictionary);
     ValidSearchQuery = DerpiAPI.CheckSearchRequest(Text);
     BackColor        =
         ValidSearchQuery ||
         String.IsNullOrEmpty(Text)
             ? Color.White
             : Color.IndianRed;
 }
Esempio n. 3
0
        private void OnAddTaskButton_Click(Object sender, EventArgs e)
        {
            if (!DerpiAPI.CheckSearchRequest(_searchQueryTextBox.Text))
            {
                return;
            }

            AddTaskControl?.Invoke(new DownloadRequest(_searchQueryTextBox.Text, _downloadPathTextBox.Text, _queueAutoDownloadCheckBox.Checked));
            if (!IsManualClose || ModifierKeys == Keys.Control || ModifierKeys == Keys.Shift)
            {
                Close();
            }

            _searchQueryTextBox.Text = String.Empty;
        }