Beispiel #1
0
        public void Initialize()
        {
            consoleListListener = new CollectionChangedEventListener(Model.ConsoleList, (_, __) => {
                while (_ConsoleLastStringList.Count < Model.ConsoleList.Count)
                {
                    int index = _ConsoleLastStringList.Count;
                    var src   = Model.ConsoleList[index];
                    var tgt   = new SummaryItemViewModel()
                    {
                        Id = index + 1
                    };
                    _ConsoleLastStringList.Add(tgt);
                    consoleTextListener.Add(
                        new CollectionChangedEventListener(
                            src.TextLines, (___, ____) => {
                        var lines = src.TextLines;
                        if (lines.Count > 0)
                        {
                            tgt.LastText    = lines[lines.Count - 1];
                            tgt.LastUpdated = DateTime.Now;
                        }
                    }));
                }
            });

            UpdateThread();
        }
Beispiel #2
0
 public void ShowItemDetail(SummaryItemViewModel item)
 {
     if (item.Data.Id - 1 < MainPanel.ConsoleList.Count)
     {
         var vm = MainPanel.ConsoleList[item.Data.Id - 1];
         MainPanel.SelectedConsolePanel = vm;
         vm.AutoScroll = true;
     }
 }
Beispiel #3
0
        public void Initialize()
        {
            ConsoleList = new ObservableViewModelCollection <SummaryItemViewModel, DisplayConsole>(Model.ConsoleList, s =>
            {
                var vm = new SummaryItemViewModel()
                {
                    Model = Model, Data = s
                };
                vm.Initialize();
                return(vm);
            });

            UpdateThread();
        }