Beispiel #1
0
        public LoadMessagesTests()
        {
            var testsData = TestsData.Create("LoadMessagesTests");

            fillTestDbHelper    = testsData.FillTestDbHelper;
            loadMessagesService = testsData.AppServiceProvider.LoadMessagesService;
        }
Beispiel #2
0
 public GetMessagesRequestHandler(NodeRequest request, NodeConnection current, ILoadMessagesService loadMessagesService, IConversationsService conversationsService)
 {
     this.request              = (GetMessagesNodeRequest)request;
     this.current              = current;
     this.loadMessagesService  = loadMessagesService;
     this.conversationsService = conversationsService;
 }
Beispiel #3
0
        public ChattingViewModel(string strRoomSID, IRoomsControlable roomsController)
        {
            if (null == strRoomSID)
            {
                throw new ArgumentNullException("strRoomSID");
            }
            if (null == roomsController)
            {
                throw new ArgumentNullException("roomsController");
            }

            this.m_AnonymousThumbnailDictionary = new Dictionary <string, Brush>();
            this.m_AnonymousThumbnailDictionary.Add(AuthRepository.MQKeyInfo.UserSid, ColorGenerator.Instance.GetRandomBrush());
            this.RoomSID           = strRoomSID;
            this.m_RoomsController = roomsController;

            this.m_SendMessageService = new SendMessageService();
            this.m_LoadMsgService     = new LoadMessagesService(AuthRepository.MQKeyInfo.UserSid, this.m_AnonymousThumbnailDictionary);
            this.m_ReadMsgService     = new ReadMessageService();

            this.InitialLoadedCommand    = new DelegateCommand <IChattingViewBehavior>(ExecuteInitialLoadedCommand);
            this.InitialFocusCommand     = new DelegateCommand <UIElement>(ExecuteInitialFocusCommand);
            this.InputTextChangedCommand = new DelegateCommand(ExecuteInputTextChangedCommand);
            this.ReSendCommand           = new DelegateCommand <CommunicationMsg>(ExecuteReSendCommand);
            this.DeletePendingMsgCommand = new DelegateCommand <CommunicationMsg>(ExecuteDeletePendingMsgCommand);
            this.SendTextCommand         = new DelegateCommand <string>(ExecuteSendTextCommand, CanExecuteSendTextCommand);
            this.DefineScrollingCommand  = new DelegateCommand <ScrollViewer>(ExecuteDefineScrollingCommand);
            this.AttachFileCommand       = new DelegateCommand(ExecuteAttachFileCommand);
            this.m_ReceiveChatMsgCommand = new DelegateCommand <ReceivedMsg>(ExecuteReceiveChatMsgCommand);
            this.m_ReceiveReadMsgCommand = new DelegateCommand <ReceivedReadMsg>(ExecuteReceiveReadMsgCommand);
            this.Messages         = new MsgCollection(this.m_LoadMsgService.LoadMessages(strRoomSID, 0).Reverse());
            this.m_UnReadMessages = this.m_LoadMsgService.LoadUnReadMessages(strRoomSID);
        }
        public CreateMessagesTests()
        {
            var testsData = TestsData.Create(nameof(CreateMessagesTests));

            createMessagesService = testsData.AppServiceProvider.CreateMessagesService;
            fillTestDbHelper      = testsData.FillTestDbHelper;
            loadMessagesService   = testsData.AppServiceProvider.LoadMessagesService;
        }
 public AttachmentsService(IAppServiceProvider appServiceProvider, IDbContextFactory <MessengerDbContext> contextFactory)
 {
     _createMessagesService = appServiceProvider.CreateMessagesService;
     _loadMessagesService   = appServiceProvider.LoadMessagesService;
     _loadDialogsService    = appServiceProvider.LoadDialogsService;
     _filesService          = appServiceProvider.FilesService;
     _pollsService          = appServiceProvider.PollsService;
     _nodeRequestSender     = appServiceProvider.NodeRequestSender;
     _loadChatsService      = appServiceProvider.LoadChatsService;
     _loadUsersService      = appServiceProvider.LoadUsersService;
     _connectionsService    = appServiceProvider.ConnectionsService;
     this.contextFactory    = contextFactory;
 }
 public GetMessagesRequestHandler(Request request,
                                  ClientConnection clientConnection,
                                  IConnectionsService connectionsService,
                                  ILoadMessagesService loadMessagesService,
                                  ICreateMessagesService createMessagesService,
                                  IAttachmentsService attachmentsService,
                                  ILoadChatsService loadChatsService,
                                  IConversationsService conversationsService,
                                  INodeRequestSender nodeRequestSender)
 {
     this.request               = (GetMessagesRequest)request;
     this.clientConnection      = clientConnection;
     this.connectionsService    = connectionsService;
     this.loadMessagesService   = loadMessagesService;
     this.createMessagesService = createMessagesService;
     this.attachmentsService    = attachmentsService;
     this.loadChatsService      = loadChatsService;
     this.conversationsService  = conversationsService;
     this.nodeRequestSender     = nodeRequestSender;
 }
Beispiel #7
0
 public SearchMessagesRequestHandler(Request request, ClientConnection clientConnection, ILoadMessagesService loadMessagesService)
 {
     this.request             = (SearchMessagesRequest)request;
     this.clientConnection    = clientConnection;
     this.loadMessagesService = loadMessagesService;
 }
Beispiel #8
0
 public GetMessageEditHistoryRequestHandler(Request request, ClientConnection clientConnection, ILoadMessagesService loadMessagesService)
 {
     this.request             = (GetMessageEditHistoryRequest)request;
     this.clientConnection    = clientConnection;
     this.loadMessagesService = loadMessagesService;
 }
Beispiel #9
0
 public MessagesController(ILoadMessagesService loadMessagesService)
 {
     _loadMessagesService = loadMessagesService;
 }
 public DeleteMessagesService(IAppServiceProvider appServiceProvider, IDbContextFactory <MessengerDbContext> contextFactory)
 {
     _loadMessagesService = appServiceProvider.LoadMessagesService;
     _loadDialogsService  = appServiceProvider.LoadDialogsService;
     this.contextFactory  = contextFactory;
 }