Exemplo n.º 1
0
        static async void Process()
        {
            try
            {
                ImgBrdProcessor processor = new ImgBrdProcessor();
                Query           q         = new Query(ImageBoardProcessor.Enumerations.QueryType.Rule34);
                q.searchTerms[0] = "renamon";
                q.searchTerms[1] = "male//female";
                Console.WriteLine("We're searching");
                var result = await processor.Rule34Search(q);

                Console.WriteLine("We got them!");
                foreach (var item in result)
                {
                    foreach (var post in item.post)
                    {
                        Console.WriteLine(post.file_url);
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine($" I dont know chief! ");
                Console.WriteLine(e.Message);
            }
        }
        public QueryTabViewModel()
        {
            QueryObj.searchName        = "E621";
            QueryObj.searchTerms[0]    = "Male";
            QueryObj.searchTerms[1]    = "";
            QueryObj.searchTerms[2]    = "";
            QueryObj.searchTerms[3]    = "";
            QueryObj.searchTerms[4]    = "";
            QueryObj.downloadDirectory = "";
            search     = new DelegateCommand(async() => await Search(), CanSearch);
            save       = new DelegateCommand(SaveQuery, CanSaveQuery);
            load       = new DelegateCommand(LoadQuery, CanLoadQuery);
            cancel     = new DelegateCommand(CancelSearch);
            OpenFolder = new DelegateCommand(LoadDirectory);
            processor  = new ImgBrdProcessor();

            _tokensource = new CancellationTokenSource();
            _token       = _tokensource.Token;

            //BindingOperations.EnableCollectionSynchronization(_data, _lock);
        }