public void CreateConversationGroup(IList conversationsVmList) { if (conversationsVmList == null) { this.Logger?.Error($"Create conversation group: Invalid conversation model type"); return; } if (!conversationsVmList.Any()) { this.Logger?.Error($"No conversations selected"); return; } var conversationGroups = this.InvestigationWindsorContainer.Resolve <VirtualizingObservableDBSetPagedCollection <ConversationsGroup> >(); var conversationGroup = new ConversationsGroup(); foreach (var conversationVm in conversationsVmList) { var convVm = conversationVm as ConversationVm; if (convVm?.Conversation == null) { this.Logger?.Error($"Create conversation group: Invalid conversation model type"); continue; } conversationGroup.AddConversation(convVm.Conversation); } conversationGroups.Add(conversationGroup); }
public ConversationsGroup CreateConversationGroup(IEnumerable <ILxConversation> conversations) { if (conversations == null) { this.Logger?.Error($"Create conversation group: Invalid conversation model type"); return(null); } var lxConversations = conversations as ILxConversation[] ?? conversations.ToArray(); if (!lxConversations.Any()) { this.Logger?.Error($"No conversations selected"); return(null); } var conversationGroups = this.InvestigationWindsorContainer.Resolve <VirtualizingObservableDBSetPagedCollection <ConversationsGroup> >(); var conversationGroup = new ConversationsGroup(); foreach (var conversation in lxConversations) { conversationGroup.AddConversation(conversation); } conversationGroups.Add(conversationGroup); return(conversationGroup); }