Example #1
0
        /// <summary>
        /// Adds a discussion reference to the current person.
        /// </summary>
        /// <param name="discussion">The discussion state with a discussion reference to add.</param>
        /// <param name="options">The options to apply before executing the REST API call.</param>
        /// <returns>
        /// A <see cref="FamilyTreePersonState"/> instance containing the REST API response.
        /// </returns>
        public FamilyTreePersonState AddDiscussionReference(DiscussionState discussion, params IStateTransitionOption[] options)
        {
            DiscussionReference reference = new DiscussionReference();

            reference.Resource = discussion.GetSelfUri();
            return(AddDiscussionReference(reference, options));
        }
Example #2
0
        protected virtual async Task PopulateStateObjects(WaterfallStepContext sc)
        {
            _discussionState = await StateHelper.RetrieveFromStateAsync
                               <ConversationState, DiscussionState>(_serviceProvider, sc.Context);

            _discussionState.UpdateActivityFromId(sc.Context);
            _onboardingState = await StateHelper.RetrieveFromStateAsync
                               <UserState, OnboardingState>(_serviceProvider, sc.Context, true);
        }
Example #3
0
        public static CommentState AsCommentState(this DiscussionState state)
        {
            switch (state)
            {
            case DiscussionState.NoActionNeeded:
                return(CommentState.NoActionNeeded);

            case DiscussionState.NeedsResolution:
                return(CommentState.NeedsResolution);

            case DiscussionState.GoodWork:
                return(CommentState.GoodWork);

            default:
                throw new ArgumentOutOfRangeException(nameof(state));
            }
        }
 /// <summary>
 /// Adds a discussion reference to the current person.
 /// </summary>
 /// <param name="discussion">The discussion state with a discussion reference to add.</param>
 /// <param name="options">The options to apply before executing the REST API call.</param>
 /// <returns>
 /// A <see cref="FamilyTreePersonState"/> instance containing the REST API response.
 /// </returns>
 public FamilyTreePersonState AddDiscussionReference(DiscussionState discussion, params IStateTransitionOption[] options)
 {
     DiscussionReference reference = new DiscussionReference();
     reference.Resource = discussion.GetSelfUri();
     return AddDiscussionReference(reference, options);
 }