docs.unity3d.com
    Show / Hide Table of Contents

    Class CommentUpdateBuilder

    Implements the ICommentUpdateBuilder interface to create a CommentCreation object.

    Inheritance
    Object
    CommentUpdateBuilder
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Cloud.Annotation.Runtime
    Syntax
    public class CommentUpdateBuilder : ICommentUpdateBuilder
    Examples
    public async Task<IComment> UpdateCommentOnTopic(ITopic topic,
        IComment commentToUpdate)
    {
        ICommentUpdateBuilder commentUpdateBuilder = new CommentUpdateBuilder(commentToUpdate);
        commentUpdateBuilder.SetText("Updated comment text")
                              .SetMarkAsRead(true);
    
        ICommentUpdate commentUpdate = commentUpdateBuilder.GetCommentUpdate();
        IComment updatedComment = await topic.UpdateCommentAsync(commentUpdate);
    
        return updatedComment;
    }

    Constructors

    CommentUpdateBuilder()

    Initializes and returns an instance of CommentUpdateBuilder.

    Declaration
    [Obsolete("Use CommentUpdateBuilder(IComment comment) instead.")]
    public CommentUpdateBuilder()

    CommentUpdateBuilder(IComment)

    Initializes and returns an instance of CommentUpdateBuilder.

    Declaration
    public CommentUpdateBuilder(IComment comment)
    Parameters
    Type Name Description
    IComment comment

    The comment to update.

    Methods

    GetCommentUpdate()

    Returns the instance of the CommentUpdate that's being built.

    Declaration
    public ICommentUpdate GetCommentUpdate()
    Returns
    Type Description
    ICommentUpdate

    The instance of the CommentUpdate that's being built.

    Implements
    ICommentUpdateBuilder.GetCommentUpdate()
    Examples
    public ICommentUpdate GetCommentUpdate(IComment commentToUpdate)
    {
        ICommentUpdateBuilder commentCreationBuilder = new CommentUpdateBuilder(commentToUpdate);
    
        commentCreationBuilder.SetText("Updated comment text");
    
        return commentCreationBuilder.GetCommentUpdate();
    }

    SetId(Guid)

    Assigns a value to the Id property of the CommentUpdate that's being built.

    Declaration
    public ICommentUpdateBuilder SetId(Guid id)
    Parameters
    Type Name Description
    Guid id

    The new ID value.

    Returns
    Type Description
    ICommentUpdateBuilder

    The current instance of the ICommentUpdateBuilder interface.

    Implements
    ICommentUpdateBuilder.SetId(Guid)
    Examples
    public async Task<IComment> UpdateCommentById(ITopic topic,
        Guid commentId)
    {
        ICommentUpdateBuilder commentUpdateBuilder = new CommentUpdateBuilder();
        commentUpdateBuilder.SetId(commentId)
            .SetText("Update comment text");
    
        ICommentUpdate commentUpdate = commentUpdateBuilder.GetCommentUpdate();
        IComment updatedComment = await topic.UpdateCommentAsync(commentUpdate);
    
        return updatedComment;
    }

    SetMarkAsRead(Boolean)

    Assigns a value to the MarkAsRead property of the CommentUpdate that's being built.

    Declaration
    public ICommentUpdateBuilder SetMarkAsRead(bool markAsRead)
    Parameters
    Type Name Description
    Boolean markAsRead

    The new MarkAsRead value.

    Returns
    Type Description
    ICommentUpdateBuilder

    The current instance of the ICommentUpdateBuilder interface.

    Implements
    ICommentUpdateBuilder.SetMarkAsRead(Boolean)
    Examples
    public async Task<IComment> UpdateCommentMarkAsReadOnTopic(ITopic topic,
        IComment commentToUpdate)
    {
        ICommentUpdateBuilder commentUpdateBuilder = new CommentUpdateBuilder(commentToUpdate);
        commentUpdateBuilder.SetMarkAsRead(true);
    
        ICommentUpdate commentUpdate = commentUpdateBuilder.GetCommentUpdate();
        IComment updatedComment = await topic.UpdateCommentAsync(commentUpdate);
    
        return updatedComment;
    }

    SetText(String)

    Assigns a value to the Text property of the CommentUpdate that's being built.

    Declaration
    public ICommentUpdateBuilder SetText(string text)
    Parameters
    Type Name Description
    String text

    The new Text value.

    Returns
    Type Description
    ICommentUpdateBuilder

    The current instance of the ICommentUpdateBuilder interface.

    Implements
    ICommentUpdateBuilder.SetText(String)
    Examples
    public async Task<IComment> UpdateCommentTextOnTopic(ITopic topic,
        IComment commentToUpdate)
    {
        ICommentUpdateBuilder commentUpdateBuilder = new CommentUpdateBuilder(commentToUpdate);
        commentUpdateBuilder.SetText("Updated comment text");
    
        ICommentUpdate commentUpdate = commentUpdateBuilder.GetCommentUpdate();
        IComment updatedComment = await topic.UpdateCommentAsync(commentUpdate);
    
        return updatedComment;
    }
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023