示例#1
0
		static string GetFirstLine (ErrorText errorText)
		{
			string firstLine = errorText.ErrorMessage ?? "";
			int idx = firstLine.IndexOfAny (new [] {'\n', '\r'});
			if (idx > 0)
				firstLine = firstLine.Substring (0, idx);
			return firstLine;
		}
示例#2
0
        static string GetFirstLine(ErrorText errorText)
        {
            string firstLine = errorText.ErrorMessage ?? "";
            int    idx       = firstLine.IndexOfAny(new [] { '\n', '\r' });

            if (idx > 0)
            {
                firstLine = firstLine.Substring(0, idx);
            }
            return(firstLine);
        }
		internal LayoutDescriptor CreateLayoutDescriptor (ErrorText errorText)
		{
			LayoutDescriptor result;
			if (!textWidthDictionary.TryGetValue (errorText.ErrorMessage, out result)) {
				Pango.Layout layout = new Pango.Layout (editor.PangoContext);
				layout.FontDescription = fontDescription;
				layout.SetText (GetFirstLine (errorText));
				int w, h;
				layout.GetPixelSize (out w, out h);
				textWidthDictionary[errorText.ErrorMessage] = result = new LayoutDescriptor (layout, w, h);
			}
			return result;
		}
示例#4
0
 internal LayoutDescriptor CreateLayoutDescriptor (ErrorText errorText)
 {
     LayoutDescriptor result;
     if (!textWidthDictionary.TryGetValue (errorText.ErrorMessage, out result))
     {
         Pango.Layout layout = new Pango.Layout (editor.PangoContext);
         layout.FontDescription = fontDescription;
         layout.SetText (GetFirstLine (errorText));
         int w, h;
         layout.GetPixelSize (out w, out h);
         textWidthDictionary[errorText.ErrorMessage] = result = new LayoutDescriptor (layout, w, h);
     }
     return result;
 }