docs.unity3d.com
    Show / Hide Table of Contents

    Interface ICommentCreationBuilder

    An interface that defines all the steps necessary to build a CommentCreation object.

    Namespace: Unity.Cloud.Annotation.Runtime
    Syntax
    public interface ICommentCreationBuilder
    Examples
    public async Task<IComment> CreateCommentOnTopic(ITopic topic,
        string commentText)
    {
        ICommentCreationBuilder commentCreationBuilder = new CommentCreationBuilder();
        commentCreationBuilder.SetText(commentText);
    
        ICommentCreation commentCreation = commentCreationBuilder.GetCommentCreation();
        IComment createdComment = await topic.CreateCommentAsync(commentCreation);
    
        return createdComment;
    }

    Methods

    GetCommentCreation()

    Returns the instance of the CommentCreation that is being built.

    Declaration
    ICommentCreation GetCommentCreation()
    Returns
    Type Description
    ICommentCreation

    The instance of the CommentCreation that is being built.

    Examples
    public ICommentCreation GetCommentCreation(string commentText)
    {
        ICommentCreationBuilder commentCreationBuilder = new CommentCreationBuilder();
    
        commentCreationBuilder.SetText(commentText);
    
        return commentCreationBuilder.GetCommentCreation();
    }

    SetText(String)

    Assigns a value to the Text property of the CommentCreation that is being built.

    Declaration
    ICommentCreationBuilder SetText(string text)
    Parameters
    Type Name Description
    String text

    The new Text value.

    Returns
    Type Description
    ICommentCreationBuilder

    The current instance of the ICommentCreationBuilder interface.

    Examples
    public async Task<IComment> CreateCommentOnTopic(ITopic topic,
        string commentText)
    {
        ICommentCreationBuilder commentCreationBuilder = new CommentCreationBuilder();
        commentCreationBuilder.SetText(commentText);
    
        ICommentCreation commentCreation = commentCreationBuilder.GetCommentCreation();
        IComment createdComment = await topic.CreateCommentAsync(commentCreation);
    
        return createdComment;
    }
    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