[hyena] [Hyena.Gui] Add FormatEscaped extension method
- From: Gabriel Burt <gburt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hyena] [Hyena.Gui] Add FormatEscaped extension method
- Date: Wed, 13 Oct 2010 20:31:09 +0000 (UTC)
commit db644786b7424823b37d01410da8c60b102980d5
Author: Gabriel Burt <gabriel burt gmail com>
Date: Wed Oct 13 15:29:30 2010 -0500
[Hyena.Gui] Add FormatEscaped extension method
Hyena.Gui/Hyena.Gui/PangoExtensions.cs | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/Hyena.Gui/Hyena.Gui/PangoExtensions.cs b/Hyena.Gui/Hyena.Gui/PangoExtensions.cs
index e593a50..9a7bcc1 100644
--- a/Hyena.Gui/Hyena.Gui/PangoExtensions.cs
+++ b/Hyena.Gui/Hyena.Gui/PangoExtensions.cs
@@ -26,6 +26,8 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
+using System.Linq;
+
using Pango;
namespace Hyena.Gui
@@ -43,5 +45,10 @@ namespace Hyena.Gui
return ((int)(metrics.Ascent + metrics.Descent) + 512) >> 10; // PANGO_PIXELS (d)
}
}
+
+ public static string FormatEscaped (this string format, params object [] args)
+ {
+ return String.Format (format, args.Select (a => GLib.Markup.EscapeText (a.ToString ())).ToArray ());
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]