public void OnNewItem(IPoderosaLogItem item) { //カテゴリ分けなどあるかもしれないが... String text = String.Format("[{0}] {1}", item.Category.Name, item.Text); int width = PoderosaLogDocument.DefaultWidth; //width文字ごとに切り取り。日本語文字があるケースは未サポート int offset = 0; while (offset < text.Length) { int next = RuntimeUtil.AdjustIntRange(offset + width, 0, text.Length); GLine line = new GLine(text.Substring(offset, next - offset).ToCharArray(), new GWord(TextDecoration.ClonedDefault(), 0, CharGroup.Hankaku)); line.EOLType = next < text.Length? EOLType.Continue : EOLType.CRLF; Append(line); offset = next; } PoderosaLogViewControl vc = _session.CurrentView; if (vc != null) { if (vc.InvokeRequired) { vc.Invoke(vc.UpdateDocumentDelegate); } else { vc.UpdateDocument(); } } }
public void InternalDetachView(IPoderosaDocument document, IPoderosaView view) { Debug.WriteLineIf(DebugOpt.LogViewer, "LogView InternalDetach"); _view = null; }
public void InternalAttachView(IPoderosaDocument document, IPoderosaView view) { _view = (PoderosaLogViewControl)view.GetAdapter(typeof(PoderosaLogViewControl)); Debug.Assert(_view != null); _view.SetParent(this); }