public /*static*/ void RunProcessingTask(SearchResult result) { // todo var task = new Task(InspectTask); task.Start(); void InspectTask() { if (!result.IsProcessed) { string?type = Network.IdentifyType(result.Url); bool isImage = Network.IsImage(type); result.MimeType = type; result.IsImage = isImage; result.IsProcessed = true; Debug.WriteLine("Process {0}", new object[] { result.Name }); } } NConsoleIO.Refresh(); }
private void SearchMonitor() { Task.WaitAll(m_tasks); var p = new SoundPlayer(RuntimeInfo.RuntimeResources.SndHint); p.Play(); Complete = true; Interface.Status = "OK"; NConsoleIO.Refresh(); }
private void RunSearchTask(ISearchEngine currentEngine) { var result = currentEngine.GetResult(m_imgUrl); m_results.Add(result); RunProcessingTask(result); // If the engine is priority, open its result in the browser if (SearchConfig.Config.PriorityEngines.HasFlag(currentEngine.Engine)) { Network.OpenUrl(result.Url); } //Update(); // Sort results m_results.Sort(CompareResults); // Reload console UI NConsoleIO.Refresh(); }