public ContactsViewModel(AppRepository appRepository, IMessageBoxService messageBoxService, IFileService fileService, ChatWorker chatWorker, ProfileViewModel profileViewModel, ContactListManager contactListManager) { this.repo = appRepository; this.messageBoxService = messageBoxService; this.fileService = fileService; this.chatWorker = chatWorker; this.profileViewModel = profileViewModel; this.contactListManager = contactListManager; }
public LockScreenView(Window mainWindow) : base(mainWindow) { this.mainWindow = mainWindow; this.deviceVaultService = App.ServiceProvider.Get <DeviceVaultService>(); this.profileViewModel = App.ServiceProvider.Get <ProfileViewModel>(); this.chatWorker = App.ServiceProvider.Get <ChatWorker>(); this.cancellation = App.ServiceProvider.Get <ICancellation>(); this.peerManager = App.ServiceProvider.Get <PeerManager>(); // we need to trigger the c'tor in PeerManager so that it registers as worker }
public ChatlogControl() { InitializeComponent(); if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(this)) { return; } _chatworker = new ChatWorker(MemoryHandler.Instance.Process); _chatworker.OnNewline += _chatworker_Delegate; lst_ChatLog.ItemsSource = _chatlog; _chatworker.StartLogging(); }
public MessagesViewModel(IServiceProvider provider, string contactGuid, IChatView messageThreadView) { this._contactId = contactGuid; this.logger = provider.Get <ILoggerFactory>().CreateLogger <MessagesViewModel>(); this._repo = provider.Get <AppRepository>(); this._messagesLoader = new MessagesLoader(this._repo, contactGuid); this._messageThreadView = messageThreadView; this._encryptionService = provider.Get <IChatEncryptionService>(); this._unreadManager = provider.Get <UnreadManager>(); this._contactListManager = provider.Get <ContactListManager>(); this._chatClient = provider.Get <IChatClient>(); this._chatWorker = provider.Get <ChatWorker>(); this._chatWorker.SendMessageStateUpdated += (sender, message) => this._messageThreadView.UpdateSendMessageStateFromBackgroundThread(message); this._chatWorker.IncomingMessageDecrypted += async(sender, message) => await AddIncomingDecryptedMessageFromChatworker(message); }
public ChatController(ILogger <LoginController> logger, AppDbContext context) { _logger = logger; _context = context; _chatWorker = new ChatWorker(_context); }