Ejemplo n.º 1
0
        public RenderHistoryLoader(ConversationModel conversationModel, HistoryCommandMessage message)
            : base(conversationModel)
        {
            _message = message;

            _builder = new HistoryBlockBuilder();
        }
Ejemplo n.º 2
0
 public void Init()
 {
     _timeFrames = InitialFrames().ToList();
     if (!_timeFrames.Any())
     {
         return;
     }
     var message = new HistoryCommandMessage
     {
         Frames = _timeFrames,
         Callback = LoadHistory
     };
     var command = new RenderHistoryLoader(_conversationThread.Model, message);
     command.Execute();
 }
Ejemplo n.º 3
0
 public Block CreateBlock(HistoryCommandMessage message)
 {
     var paragraph = new Paragraph();
     paragraph.Inlines.Add("Show messages from: ");
     foreach (var timeFrameParam in message.Frames)
     {
         Inline frame;
         if (timeFrameParam.Enabled)
         {
             var hyperlink = new Hyperlink(new Run(timeFrameParam.DisplayingValue));
             var param = timeFrameParam;
             hyperlink.Click += (sender, args) => message.Callback(param);
             frame = hyperlink;
         }
         else
         {
             var disabled = new Bold(new Run(timeFrameParam.DisplayingValue));
             frame = disabled;
         }
         paragraph.Inlines.Add(frame);
         paragraph.Inlines.Add(new Run(" "));
     }
     return paragraph;
 }
Ejemplo n.º 4
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();
        }