Exemple #1
0
        void ILogComponent.Write(string text, EntryType type)
        {
            var ln = Line.FromString(text);

            ln.State = (int)type;
            Document.Lines.RemoveAt(Document.Lines.Count - 1);
            Document.Lines.Add(ln);
            Document.Lines.Add(Line.Empty());
            Selections.Set(new Pos(Document.Lines.Count - 1, 0));
            InvalidateLines();
            ScrollToCaret();
            RequestRedraw();
            OnEntryWritten(text, type);
        }
Exemple #2
0
        public void Truncate(string text = "")
        {
            var @lock = ObtainLock();

            try
            {
                Document.Lines.Clear();
                //Document.Lines.Add(Line.FromString(text));
                Document.Lines.AddRange(text.MakeCharacters().MakeLines().Select(cz => new Line(cz)));
                Selections.Set(new Pos(0, 0));
                Edits = 0;

                foreach (var v in Editors)
                {
                    v.AttachBuffer(this);
                }
            }
            finally
            {
                @lock.Release();
            }
        }