void RemoveDialogHandler(TwoChatsHandlerAndAnother dialogAndAnother) { allDialogsList.Remove(dialogAndAnother); FactoryOfChatHandler.OnChatsDisposed( dialogAndAnother.TwoChatsHandler.Chat1, dialogAndAnother.TwoChatsHandler.Chat2, dialogAndAnother.TwoChatsHandler.Status ); dialogAndAnother.TwoChatsHandler.StopCallForwarding(); dialogAndAnother.TwoChatsHandler.Free(); }
TwoChatsHandlerAndAnother AddNewDialogHandler() { TwoChatsHandler dialog = new TwoChatsHandler( ChatsSettings, FactoryOfChatHandler.CreateChat1(ChatsSettings), FactoryOfChatHandler.CreateChat2(ChatsSettings) ); ///////////////////////// TwoChatsHandlerAndAnother newItem = new TwoChatsHandlerAndAnother(dialog); allDialogsList.Add(newItem); newItem.DoOnNextLoop = CommandToDoWithChat.Start; return(newItem); }