docs.unity3d.com
    Show / Hide Table of Contents

    Class CommentCreationBuilder

    Implements the ICommentCreationBuilder interface to create a CommentCreation object.

    Inheritance
    Object
    CommentCreationBuilder
    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 CommentCreationBuilder : 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;
    }

    Constructors

    CommentCreationBuilder()

    Initializes and returns an instance of CommentCreationBuilder.

    Declaration
    public CommentCreationBuilder()

    Methods

    GetCommentCreation()

    Returns the instance of the CommentCreation that is being built.

    Declaration
    public ICommentCreation GetCommentCreation()
    Returns
    Type Description
    ICommentCreation

    The instance of the CommentCreation that is being built.

    Implements
    ICommentCreationBuilder.GetCommentCreation()
    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
    public 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.

    Implements
    ICommentCreationBuilder.SetText(String)
    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