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