本文整理汇总了C#中Resources.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# Resources.GetString方法的具体用法?C# Resources.GetString怎么用?C# Resources.GetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Resources
的用法示例。
在下文中一共展示了Resources.GetString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetStringFromPlugin
public static string GetStringFromPlugin(Resources pluginRes, string pluginPackage, string stringId)
{
int titleId = pluginRes.GetIdentifier(pluginPackage + ":string/" + stringId, null, null);
string title = null;
if (titleId != 0)
title = pluginRes.GetString(titleId);
return title;
}
示例2: PopulateChoiceEntry
// Initializes a single choice type restriction entry.
public static void PopulateChoiceEntry (Resources res, RestrictionEntry reSingleChoice)
{
String[] choiceEntries = res.GetStringArray (Resource.Array.choice_entry_entries);
String[] choiceValues = res.GetStringArray (Resource.Array.choice_entry_values);
if (reSingleChoice.SelectedString == null)
reSingleChoice.SelectedString = choiceValues [0];
reSingleChoice.Title = res.GetString (Resource.String.choice_entry_title);
reSingleChoice.SetChoiceEntries (choiceEntries);
reSingleChoice.SetChoiceValues (choiceValues);
reSingleChoice.Type = RestrictionEntryType.Choice;
}
示例3: PopulateMultiEntry
// Initializes a multi-select type restriction entry.
public static void PopulateMultiEntry (Resources res, RestrictionEntry reMultiSelect)
{
String[] multiEntries = res.GetStringArray (Resource.Array.multi_entry_entries);
String[] multiValues = res.GetStringArray (Resource.Array.multi_entry_values);
if (reMultiSelect.GetAllSelectedStrings() == null)
reMultiSelect.SetAllSelectedStrings (new String[0]);
reMultiSelect.Title = res.GetString (Resource.String.multi_entry_title);
reMultiSelect.SetChoiceEntries (multiEntries);
reMultiSelect.SetChoiceValues (multiValues);
reMultiSelect.Type = RestrictionEntryType.MultiSelect;
}
示例4: PopulateBooleanEntry
// Initializes a boolean type restriction entry.
public static void PopulateBooleanEntry (Resources res, RestrictionEntry entry)
{
entry.Type = RestrictionEntryType.Boolean;
entry.Title = res.GetString (Resource.String.boolean_entry_title);
}
示例5: GetValue
public override object GetValue(Resources resources, int resourceId, Type memberType)
{
return resources.GetString(resourceId);
}