public void AddItem(LogHistoryItem item) { _LogHistory.AddCommandLine(item); if (_LogHistory.LogCount >= 1) { _LogHistoryView.ScrollToShowItem(_LogHistory[_LogHistory.LogCount - 1]); } }
private void HandleReturnKeyPressed() { if (0 == _commandInput.CompareTo("")) { return; } //保存command line到loghistoryview中 LogHistoryItem item = new LogHistoryItem(LogHistoryLogType.ConsoleInput, _commandInput, Time.time); _LogHistory.AddCommandLine(item); //判断_commandInput是否来自预设命令 CommandHandlers.HandleCommand(_commandInput); //清空command line数据 _commandInput = ""; Event.current.Use(); _LogHistoryView.ScrollToShowItem(_LogHistory[_LogHistory.LogCount - 1]); }