public virtual void LoadStream (Stream input, TextFormat format) { var buffer = Backend.CreateBuffer (); format.Parse (input, buffer); Backend.SetBuffer (buffer); OnPreferredSizeChanged (); }
public void LoadText(string text, TextFormat format) { using (var stream = new MemoryStream (Encoding.UTF8.GetBytes (text), false)) LoadStream (stream, format); }
public void LoadFile(string fileName, TextFormat format) { using (var stream = new FileStream (fileName, FileMode.Open, FileAccess.Read)) LoadStream (stream, format); }