コード例 #1
0
            /// <summary>
            /// Add new Conversation.
            /// </summary>
            /// <param name="author">Author of Conversation.</param>
            /// <param name="content">Content of Conversation.</param>
            /// <param name="attributes">Additional attributes that should be set for Conversation</param>
            /// <returns>Newly created Conversation.</returns>
            public Conversation Conversation(Member author, string content, IDictionary<string, object> attributes) {
                var conversation = new Conversation(instance) {
                    Author = author, 
                    AuthoredAt = DateTime.UtcNow, 
                    Content = content
                };
                AddAttributes(conversation, attributes);
                conversation.Save();

                return conversation;
            }
コード例 #2
0
            /// <summary>
            /// Add new Expression
            /// </summary>
            /// <param name="author">Author of Expression</param>
            /// <param name="content">Content of Expression</param>
            /// <param name="attributes">Additional attributes that should be set for Expression</param>
            /// <param name="belongsTo">Conversation This Expression belongs to</param>
            /// <param name="inReplyTo">The Expression being replied To</param>
            /// <returns></returns>
            public Expression Expression(Member author, string content, IDictionary<string, object> attributes, Conversation belongsTo, Expression inReplyTo)
            {
                var expression = new Expression(instance)
                {
                    Author = author,
                    AuthoredAt = DateTime.UtcNow,
                    Content = content,
                };

                if (belongsTo != null) expression.BelongsTo = belongsTo;
                if (inReplyTo != null) expression.InReplyTo = inReplyTo;

                AddAttributes(expression, attributes);
                expression.Save();
                return expression;
            }
コード例 #3
0
 /// <summary>
 /// Add new Conversation with One Expression
 /// </summary>
 /// <param name="author">Author of Conversation Expression.</param>
 /// <param name="content">Content of Conversation Expression.</param>
 /// <param name="attributes">Additional attributes that should be set for Conversation</param>
 /// <returns>Newly created Conversation.</returns>
 public Conversation Conversation(Member author, string content, IDictionary<string, object> attributes)
 {
     var conversation = new Conversation(instance);                
     conversation.Save();
     var expression = Expression(author, content, attributes, conversation, null);
     if (attributes != null) AddAttributes(conversation, attributes);
     expression.Save();
     return instance.Get.ConversationByID(conversation.ID);
 }
コード例 #4
0
 /// <summary>
 /// Add new Expression
 /// </summary>
 /// <param name="author">Author of Expression</param>
 /// <param name="content">Content of Expression</param>
 /// <param name="belongsTo">Conversation This Expression belongs to</param>
 /// <param name="inReplyTo">The Expression being replied To</param>
 /// <returns></returns>
 public Expression Expression(Member author, string content, Conversation belongsTo, Expression inReplyTo = null)
 {
     return Expression(author, content, null, belongsTo, inReplyTo);
 }
コード例 #5
0
 /// <summary>
 /// Add new Expression with author as current logged user.
 /// </summary>
 /// <param name="content">Content of Expression.</param>
 /// <param name="belongsTo">Conversation this Expression Belongs To</param>
 /// <returns>Newly created Expression.</returns>
 public Expression Expression(string content, Conversation belongsTo)
 {
     return Expression(instance.LoggedInMember, content, null, belongsTo, null);
 }