コード例 #1
0
        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));
        }
コード例 #2
0
        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();
        }
コード例 #3
0
 private void SuggestionView_Dismissed(ActivitiesSuggestion suggestion)
 {
     this.DeclineSuggestion(suggestion);
 }
コード例 #4
0
 public void AddSuggestion(ActivitiesSuggestion suggestion)
 {
     this.suggestions.Add(suggestion);
     this.UpdateSuggestionsAndMessage();
     this.previousDeclinedSuggestion = null;
 }
コード例 #5
0
 public void RemoveSuggestion(ActivitiesSuggestion suggestion)
 {
     this.suggestions.Remove(suggestion);
     this.UpdateSuggestionsAndMessage();
 }