/// <summary>
 /// Initializes a new instance of the ConversationParameters class.
 /// </summary>
 public ConversationParameters(ChannelAccount bot = default(ChannelAccount), bool? isGroup = default(bool?), IList<ChannelAccount> members = default(IList<ChannelAccount>), string topicName = default(string))
 {
     Bot = bot;
     IsGroup = isGroup;
     Members = members;
     TopicName = topicName;
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the Activity class.
 /// </summary>
 public Activity(string type = default(string), string id = default(string), DateTime? timestamp = default(DateTime?), string serviceUrl = default(string), string channelId = default(string), ChannelAccount from = default(ChannelAccount), ConversationAccount conversation = default(ConversationAccount), ChannelAccount recipient = default(ChannelAccount), string textFormat = default(string), string attachmentLayout = default(string), IList<ChannelAccount> membersAdded = default(IList<ChannelAccount>), IList<ChannelAccount> membersRemoved = default(IList<ChannelAccount>), string topicName = default(string), bool? historyDisclosed = default(bool?), string locale = default(string), string text = default(string), string summary = default(string), IList<Attachment> attachments = default(IList<Attachment>), IList<Entity> entities = default(IList<Entity>), object channelData = default(object), string action = default(string), string replyToId = default(string))
 {
     Type = GetActivityType(type);
     Id = id;
     Timestamp = timestamp;
     ServiceUrl = serviceUrl;
     ChannelId = channelId;
     From = from;
     Conversation = conversation;
     Recipient = recipient;
     TextFormat = textFormat;
     AttachmentLayout = attachmentLayout;
     MembersAdded = membersAdded;
     MembersRemoved = membersRemoved;
     TopicName = topicName;
     HistoryDisclosed = historyDisclosed;
     Locale = locale;
     Text = text;
     Summary = summary;
     Attachments = attachments;
     Entities = entities;
     ChannelData = channelData;
     Action = action;
     ReplyToId = replyToId;
 }
Example #3
0
 /// <summary>
 /// Create a new direct conversation between a bot and a user
 /// </summary>
 /// <param name='operations'>The operations group for this extension method.</param>
 /// <param name='bot'>Bot to create conversation from</param>
 /// <param name='user'>User to create conversation with</param>
 public static ResourceResponse CreateDirectConversation(this IConversations operations, ChannelAccount bot, ChannelAccount user)
 {
     return Task.Factory.StartNew(s => ((IConversations)s).CreateConversationAsync(GetDirectParameters(bot, user)), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
Example #4
0
 /// <summary>
 /// Create a new direct conversation between a bot and a user
 /// </summary>
 /// <param name='operations'>The operations group for this extension method.</param>
 /// <param name='bot'>Bot to create conversation from</param>
 /// <param name='user'>User to create conversation with</param>
 /// <param name='cancellationToken'>The cancellation token.</param>
 public static async Task<ResourceResponse> CreateDirectConversationAsync(this IConversations operations, ChannelAccount bot, ChannelAccount user, CancellationToken cancellationToken = default(CancellationToken))
 {
     var _result = await operations.CreateConversationWithHttpMessagesAsync(GetDirectParameters(bot, user), null, cancellationToken).ConfigureAwait(false);
     return _result.HandleError<ResourceResponse>();
 }
Example #5
0
 private static ConversationParameters GetDirectParameters(ChannelAccount bot, ChannelAccount user)
 {
     return new ConversationParameters() { Bot = bot, Members = new ChannelAccount[] { user } };
 }