本文整理汇总了C#中Pango.FontDescription.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Pango.FontDescription.ToString方法的具体用法?C# Pango.FontDescription.ToString怎么用?C# Pango.FontDescription.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pango.FontDescription
的用法示例。
在下文中一共展示了Pango.FontDescription.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: _Load
//.........这里部分代码省略.........
}
colorButton = (Gtk.ColorButton)_Glade["BackgroundColorButton"];
colorHexCode = (string)Frontend.UserConfig["Interface/Chat/BackgroundColor"];
if (String.IsNullOrEmpty(colorHexCode)) {
((Gtk.CheckButton)_Glade["OverrideBackgroundColorCheckButton"]).Active = false;
} else {
((Gtk.CheckButton)_Glade["OverrideBackgroundColorCheckButton"]).Active = true;
colorButton.Color = ColorTools.GetGdkColor(colorHexCode);
}
Gtk.FontButton fontButton = (Gtk.FontButton)_Glade["FontButton"];
string fontFamily = (string)Frontend.UserConfig["Interface/Chat/FontFamily"];
string fontStyle = (string)Frontend.UserConfig["Interface/Chat/FontStyle"];
int fontSize = 0;
if (Frontend.UserConfig["Interface/Chat/FontSize"] != null) {
fontSize = (int) Frontend.UserConfig["Interface/Chat/FontSize"];
}
if (String.IsNullOrEmpty(fontFamily) &&
String.IsNullOrEmpty(fontStyle) &&
fontSize == 0) {
((Gtk.CheckButton)_Glade["OverrideFontCheckButton"]).Active = false;
} else {
((Gtk.CheckButton)_Glade["OverrideFontCheckButton"]).Active = true;
Pango.FontDescription fontDescription = new Pango.FontDescription();
fontDescription.Family = fontFamily;
string frontWeigth = null;
if (fontStyle.Contains(" ")) {
int pos = fontStyle.IndexOf(" ");
frontWeigth = fontStyle.Substring(0, pos);
fontStyle = fontStyle.Substring(pos + 1);
}
fontDescription.Style = (Pango.Style) Enum.Parse(typeof(Pango.Style), fontStyle);
if (frontWeigth != null) {
fontDescription.Weight = (Pango.Weight) Enum.Parse(typeof(Pango.Weight), frontWeigth);
}
fontDescription.Size = fontSize * 1024;
fontButton.FontName = fontDescription.ToString();
}
Gtk.ComboBox wrapModeComboBox = ((Gtk.ComboBox)_Glade["WrapModeComboBox"]);
Gtk.WrapMode wrapMode = (Gtk.WrapMode) Enum.Parse(
typeof(Gtk.WrapMode),
(string) Frontend.UserConfig["Interface/Chat/WrapMode"]
);
int i = 0;
foreach (object[] row in (Gtk.ListStore) wrapModeComboBox.Model) {
if (((Gtk.WrapMode) row[0]) == wrapMode) {
wrapModeComboBox.Active = i;
break;
}
i++;
}
// Interface/Entry
((Gtk.Entry)_Glade["CompletionCharacterEntry"]).Text =
(string)Frontend.UserConfig["Interface/Entry/CompletionCharacter"];
((Gtk.Entry)_Glade["CommandCharacterEntry"]).Text =
(string)Frontend.UserConfig["Interface/Entry/CommandCharacter"];
((Gtk.CheckButton)_Glade["BashStyleCompletionCheckButton"]).Active =
(bool)Frontend.UserConfig["Interface/Entry/BashStyleCompletion"];
((Gtk.SpinButton)_Glade["CommandHistorySizeSpinButton"]).Value =
(double)(int)Frontend.UserConfig["Interface/Entry/CommandHistorySize"];
((Gtk.CheckButton)_Glade["BeepOnHighlightCheckButton"]).Active =
(bool)Frontend.UserConfig["Sound/BeepOnHighlight"];
// Interface/Notification
string modeStr = (string) Frontend.UserConfig["Interface/Notification/NotificationAreaIconMode"];
NotificationAreaIconMode mode = (NotificationAreaIconMode) Enum.Parse(
typeof(NotificationAreaIconMode),
modeStr
);
switch (mode) {
case NotificationAreaIconMode.Never:
((Gtk.CheckButton) _Glade["NotificationAreaIconCheckButton"]).Active = false;
((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonMinimized"]).Active = true;
break;
case NotificationAreaIconMode.Always:
((Gtk.CheckButton) _Glade["NotificationAreaIconCheckButton"]).Active = true;
((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonAlways"]).Active = true;
break;
case NotificationAreaIconMode.Minimized:
((Gtk.CheckButton) _Glade["NotificationAreaIconCheckButton"]).Active = true;
((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonMinimized"]).Active = true;
break;
case NotificationAreaIconMode.Closed:
((Gtk.CheckButton) _Glade["NotificationAreaIconCheckButton"]).Active = true;
((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonClosed"]).Active = true;
break;
}
// Filters
_ChannelFilterListView.Load();
// Servers
_ServerListView.Load();
((Gtk.Button)_Glade["ApplyButton"]).Sensitive = false;
}
示例2: _Load
//.........这里部分代码省略.........
if (String.IsNullOrEmpty(colorHexCode)) {
((Gtk.CheckButton)_Glade["OverrideBackgroundColorCheckButton"]).Active = false;
} else {
((Gtk.CheckButton)_Glade["OverrideBackgroundColorCheckButton"]).Active = true;
colorButton.Color = ColorConverter.GetGdkColor(colorHexCode);
}
Gtk.FontButton fontButton = (Gtk.FontButton)_Glade["FontButton"];
string fontFamily = (string)Frontend.UserConfig["Interface/Chat/FontFamily"];
string fontStyle = (string)Frontend.UserConfig["Interface/Chat/FontStyle"];
int fontSize = 0;
if (Frontend.UserConfig["Interface/Chat/FontSize"] != null) {
fontSize = (int) Frontend.UserConfig["Interface/Chat/FontSize"];
}
if (String.IsNullOrEmpty(fontFamily) &&
String.IsNullOrEmpty(fontStyle) &&
fontSize == 0) {
((Gtk.CheckButton)_Glade["OverrideFontCheckButton"]).Active = false;
} else {
((Gtk.CheckButton)_Glade["OverrideFontCheckButton"]).Active = true;
Pango.FontDescription fontDescription = new Pango.FontDescription();
fontDescription.Family = fontFamily;
string frontWeigth = null;
if (fontStyle.Contains(" ")) {
int pos = fontStyle.IndexOf(" ");
frontWeigth = fontStyle.Substring(0, pos);
fontStyle = fontStyle.Substring(pos + 1);
}
fontDescription.Style = (Pango.Style) Enum.Parse(typeof(Pango.Style), fontStyle);
if (frontWeigth != null) {
fontDescription.Weight = (Pango.Weight) Enum.Parse(typeof(Pango.Weight), frontWeigth);
}
fontDescription.Size = fontSize * 1024;
fontButton.FontName = fontDescription.ToString();
}
Gtk.ComboBox wrapModeComboBox = ((Gtk.ComboBox)_Glade["WrapModeComboBox"]);
Gtk.WrapMode wrapMode = (Gtk.WrapMode) Enum.Parse(
typeof(Gtk.WrapMode),
(string) Frontend.UserConfig["Interface/Chat/WrapMode"]
);
if (wrapMode == Gtk.WrapMode.Word) {
wrapMode = Gtk.WrapMode.WordChar;
}
i = 0;
foreach (object[] row in (Gtk.ListStore) wrapModeComboBox.Model) {
if (((Gtk.WrapMode) row[0]) == wrapMode) {
wrapModeComboBox.Active = i;
break;
}
i++;
}
// Interface/Entry
((Gtk.Entry)_Glade["CompletionCharacterEntry"]).Text =
(string)Frontend.UserConfig["Interface/Entry/CompletionCharacter"];
((Gtk.Entry)_Glade["CommandCharacterEntry"]).Text =
(string)Frontend.UserConfig["Interface/Entry/CommandCharacter"];
((Gtk.CheckButton)_Glade["BashStyleCompletionCheckButton"]).Active =
(bool)Frontend.UserConfig["Interface/Entry/BashStyleCompletion"];
((Gtk.SpinButton)_Glade["CommandHistorySizeSpinButton"]).Value =
(double)(int)Frontend.UserConfig["Interface/Entry/CommandHistorySize"];
var highlight_words =
(string[]) Frontend.UserConfig["Interface/Chat/HighlightWords"];
// backwards compatibility with 0.7.x servers