private LayoutChoice_Set makeLayout(ActivitiesSuggestion suggestion, bool doNowButton, Dictionary <ActivitySuggestion, bool> repeatingDeclinedSuggestion) { SuggestionView suggestionView = new SuggestionView(suggestion, doNowButton, repeatingDeclinedSuggestion, this.layoutStack); suggestionView.Dismissed += SuggestionView_Dismissed; suggestionView.JustifySuggestion += SuggestionView_JustifySuggestion; suggestionView.AcceptedSuggestion += SuggestionView_VisitParticipationScreen; suggestionView.VisitActivitiesScreen += SuggestionView_VisitActivitiesScreen; suggestionView.Request_MakeNewActivity += SuggestionView_Request_MakeNewActivity; return(new LayoutCache(suggestionView)); }
private void DeclineSuggestion(ActivitiesSuggestion suggestion) { this.previousDeclinedSuggestion = suggestion; this.suggestions.Remove(suggestion); ActivitySkip skip = this.recommender.DeclineSuggestion(suggestion); double numSecondsThinking = skip.ThinkingTime.TotalSeconds; string message = "Recorded " + (int)numSecondsThinking + " seconds (wasted) considering " + suggestion.Children[0].ActivityDescriptor.ActivityName; if (suggestion.Children.Count > 1) { message += ", ..."; } this.SetErrorMessage(message); this.Update_Suggestion_StartTimes(); this.UpdateLayout_From_Suggestions(); }
private void SuggestionView_Dismissed(ActivitiesSuggestion suggestion) { this.DeclineSuggestion(suggestion); }
public void AddSuggestion(ActivitiesSuggestion suggestion) { this.suggestions.Add(suggestion); this.UpdateSuggestionsAndMessage(); this.previousDeclinedSuggestion = null; }
public void RemoveSuggestion(ActivitiesSuggestion suggestion) { this.suggestions.Remove(suggestion); this.UpdateSuggestionsAndMessage(); }