/// <summary> /// Adds a discussion to the current collection. /// </summary> /// <param name="discussion">The discussion.</param> /// <param name="options">The options to apply before executing the REST API call.</param> /// <returns> /// A <see cref="DiscussionState"/> instance containing the REST API response. /// </returns> /// <exception cref="Gx.Rs.Api.GedcomxApplicationException">Thrown if a link to the required resource cannot be found.</exception> public DiscussionState AddDiscussion(Discussion discussion, params IStateTransitionOption[] options) { Link link = GetLink(Rel.DISCUSSIONS); if (link == null || link.Href == null) { throw new GedcomxApplicationException("Unable to add discussion: missing link."); } FamilySearchPlatform entity = new FamilySearchPlatform(); entity.AddDiscussion(discussion); IRestRequest request = RequestUtil.ApplyFamilySearchConneg(CreateAuthenticatedRequest()).SetEntity(entity).Build(link.Href, Method.POST); return ((FamilySearchStateFactory)this.stateFactory).NewDiscussionState(request, Invoke(request, options), this.Client, this.CurrentAccessToken); }
public virtual void VisitDiscussion(Discussion discussion) { this.contextStack.Push(discussion); List<Comment> comments = discussion.Comments; if (comments != null) { foreach (Comment comment in comments) { comment.Accept(this); } } this.contextStack.Pop(); }
/** * Add a discussion to the data set. * * @param discussion The discussion to be added. */ public void AddDiscussion(Discussion discussion) { if (discussion != null) { if (_discussions == null) _discussions = new List<Discussion>(); _discussions.Add(discussion); } }
/** * Build out this document with a discussion. * * @param discussion The discussion to be added. * @return this. */ public FamilySearchPlatform SetDiscussion(Discussion discussion) { AddDiscussion(discussion); return this; }
public override void VisitDiscussion(Discussion discussion) { BindIfNeeded(discussion); base.VisitDiscussion(discussion); }