Ejemplo n.º 1
0
        protected virtual string ResultFromSearch(string unsanitized_title, Func <LookupContext, LookupChoice> choiceCallback)
        {
            LookupContext result = Search(unsanitized_title);
            LookupChoice  choice = choiceCallback(result);

            return(choice.Run(newTitleToSearch => ResultFromSearch(newTitleToSearch, choiceCallback)));
        }
Ejemplo n.º 2
0
 public LookupChoice(LookupChoice.Action action)
 {
     if (action == LookupChoice.Action.NewSearch)
     {
         throw new ArgumentException("Invalid LookupChoice. NewSerch needs a new title to use.");
     }
     this.action = action;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// A Retry LookupChoice to retry with a new title.
 /// </summary>
 /// <param name="action">MUST be LookupChoice.Action.NewSearch</param>
 /// <param name="newTitleToSearch">The new title to retry searching for</param>
 public LookupChoice(LookupChoice.Action action, string newTitleToSearch)
 {
     if (action!=LookupChoice.Action.NewSearch)
     {
         throw new ArgumentException("Invalid. Action must be set to LookupChoice.Action.NewSearch when using a newTitleToSearch");
     }
     this.action = action;
     this.newTitleToSearch = newTitleToSearch;
 }
Ejemplo n.º 4
0
 public void RetrySearch()
 {
     if(String.IsNullOrWhiteSpace(SearchText))
     {
         return;
     }
     LookupChoice = new LookupChoice(LookupChoice.Action.NewSearch, SearchText);
     DialogResult = true;
 }
Ejemplo n.º 5
0
 public void PickSelected()
 {
     LookupChoice = new LookupChoice(SelectedItem.ImdbId);
     DialogResult = true;
 }