本文整理汇总了C#中Resources.GetStringArray方法的典型用法代码示例。如果您正苦于以下问题:C# Resources.GetStringArray方法的具体用法?C# Resources.GetStringArray怎么用?C# Resources.GetStringArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Resources
的用法示例。
在下文中一共展示了Resources.GetStringArray方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: GetArrayValue
public override IEnumerable GetArrayValue(Resources resources, int resourceId, Type memberType)
{
IEnumerable collection = null;
// get the type fromthe member
var elementType = memberType.GetEnumerableElementType();
if (elementType != null)
{
if (elementType == typeof(int))
collection = resources.GetIntArray(resourceId);
else if (elementType == typeof(string))
collection = resources.GetStringArray(resourceId);
}
// we don't know how to handle collections without a type
return collection;
}
示例3: GetValue
public override object GetValue(Resources resources, int resourceId, Type memberType)
{
return resources.GetStringArray(resourceId);
}
示例4: 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;
}