示例#1
0
 public void Dispose()
 {
     layout.ClearAttributes();
     layout.Width         = -1;
     layout.TextAlignment = Xwt.Alignment.Start;
     layoutCache.layoutQueue.Enqueue(this);
 }
示例#2
0
 public void AssignTo(TextLayout layout)
 {
     layout.ClearAttributes();
     foreach (var item in list)
     {
         layout.AddAttribute(item);
     }
 }
		static void HighlightSearchResults (TextLayout layout, string search, Color foreground, Color background)
		{
			string text = null;
			if (layout != null) {
				text = layout.Text;
				layout.ClearAttributes ();
			}
			if (string.IsNullOrEmpty (text) || string.IsNullOrEmpty (search))
				return;
			int index = 0;
			while ((index = text.IndexOf (search, index, StringComparison.OrdinalIgnoreCase)) > -1) {
				layout.SetForeground (foreground, index, search.Length);
				layout.SetBackground (background, index, search.Length);
				index++;
			}
		}