Пример #1
0
 private void DisableTimeFrames(TimeFrameParam target)
 {
     foreach (var frameParam in _timeFrames)
     {
         frameParam.Enabled = false;
         if (frameParam == target)
         {
             return;
         }
     }
 }
Пример #2
0
 private void RenderHistory(TimeFrameParam param)
 {
     IEnumerable<IMessage> messages;
     messages = _currentFrame == null
         ? HistoryService.Read(_clientId, _withEntity, param.Span)
         : HistoryService.Read(_clientId, _withEntity, param.Span, _currentFrame.Span);
     _currentFrame = param;
     foreach (var message in messages.Reverse())
     {
         var command = new RenderHistoryMessage(_conversationThread.Model, message);
         command.Execute();
     }
 }
Пример #3
0
        private void LoadHistory(TimeFrameParam param)
        {
            var removeControl = new RemoveHistoryLoader(_conversationThread.Model);
            removeControl.Execute();

            RenderHistory(param);
            DisableTimeFrames(param);

            if (!_timeFrames.Last().Enabled)
            {
                return;
            }
            var message = new HistoryCommandMessage
            {
                Frames = _timeFrames,
                Callback = LoadHistory
            };

            var addControl = new RenderHistoryLoader(_conversationThread.Model, message);
            addControl.Execute();
        }