//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005, 2007 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Authors:
-//
-// Jordi Mas i Hernandez <jordimash@gmail.com>
-//
+// Jordi Mas i Hernandez <jordimash@gmail.com>
+// Sebastien Pouliot <sebastien@ximian.com>
//
#if NET_2_0
-using System;
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-using System.ComponentModel;
-
-namespace System.Drawing
-{
- public sealed class SystemFonts\r
- {
- private static Font caption = null;
- private static Font defaultfnt = null;\r
- private static Font dialog = null;\r
- private static Font icon = null;\r
- private static Font menu = null;\r
- private static Font message = null;\r
- private static Font smallcaption = null;\r
- private static Font status = null;
- \r
+namespace System.Drawing {
+
+ public sealed class SystemFonts {
+
static SystemFonts ()
{
-
}
-\r
+
private SystemFonts()
{
+ }
- }\r
-\r
- public static Font GetFontByName (string name)
+ public static Font GetFontByName (string systemFontName)
{
- if (name == "CaptionFont")
+ if (systemFontName == "CaptionFont")
return CaptionFont;
- if (name == "DefaultFont")
+ if (systemFontName == "DefaultFont")
return DefaultFont;
- if (name == "DialogFont")
+ if (systemFontName == "DialogFont")
return DialogFont;
- if (name == "IconTitleFont")
+ if (systemFontName == "IconTitleFont")
return IconTitleFont;
- if (name == "MenuFont")
+ if (systemFontName == "MenuFont")
return MenuFont;
- if (name == "MessageBoxFont")
+ if (systemFontName == "MessageBoxFont")
return MessageBoxFont;
- if (name == "SmallCaptionFont")
+ if (systemFontName == "SmallCaptionFont")
return SmallCaptionFont;
- if (name == "StatusFont")
+ if (systemFontName == "StatusFont")
return StatusFont;
return null;
}
-\r
+
public static Font CaptionFont {
- get {
- if (caption == null) {
- caption = new Font ("Microsoft Sans Serif", 11);
- caption.SysFontName = "CaptionFont";
- }
- return caption;
- }
+ get { return new Font ("Microsoft Sans Serif", 11, "CaptionFont"); }
}
-\r
+
public static Font DefaultFont {
- get {
- if (defaultfnt == null) {
- defaultfnt = new Font ("Microsoft Sans Serif", 8.25f);
- defaultfnt.SysFontName = "DefaultFont";
- }
- return defaultfnt;
- }
+ get { return new Font ("Microsoft Sans Serif", 8.25f, "DefaultFont"); }
}
-\r
+
public static Font DialogFont {
- get {
- if (dialog == null) {
- dialog = new Font ("Tahoma", 8);
- dialog.SysFontName = "DialogFont";
- }
- return dialog;
- }
+ get { return new Font ("Tahoma", 8, "DialogFont"); }
}
-\r
+
public static Font IconTitleFont {
- get {
- if (icon == null) {
- icon = new Font ("Microsoft Sans Serif", 11);
- icon.SysFontName = "IconTitleFont";
- }
- return icon;
- }
+ get { return new Font ("Microsoft Sans Serif", 11, "IconTitleFont"); }
}
-\r
+
public static Font MenuFont {
- get {
- if (menu == null) {
- menu = new Font ("Microsoft Sans Serif", 11);
- menu.SysFontName = "MenuFont";
- }
- return menu;
- }
+ get { return new Font ("Microsoft Sans Serif", 11, "MenuFont"); }
}
-\r
+
public static Font MessageBoxFont {
- get {
- if (message == null) {
- message = new Font ("Microsoft Sans Serif", 11);
- message.SysFontName = "MessageBoxFont";
- }
- return message;
- }
+ get { return new Font ("Microsoft Sans Serif", 11, "MessageBoxFont"); }
}
-\r
+
public static Font SmallCaptionFont {
- get {
- if (smallcaption == null) {
- smallcaption = new Font ("Microsoft Sans Serif", 11);
- smallcaption.SysFontName = "SmallCaptionFont";
- }
- return smallcaption;
- }
+ get { return new Font ("Microsoft Sans Serif", 11, "SmallCaptionFont"); }
}
public static Font StatusFont {
- get {
- if (status == null) {
- status = new Font ("Microsoft Sans Serif", 11);
- status.SysFontName = "StatusFont";
- }
- return status;
- }
- } \r
+ get { return new Font ("Microsoft Sans Serif", 11, "StatusFont"); }
+ }
}
}
-#endif
\ No newline at end of file
+#endif