本文整理汇总了C#中Commons.Collections.ExtendedProperties.GetStringList方法的典型用法代码示例。如果您正苦于以下问题:C# ExtendedProperties.GetStringList方法的具体用法?C# ExtendedProperties.GetStringList怎么用?C# ExtendedProperties.GetStringList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Commons.Collections.ExtendedProperties
的用法示例。
在下文中一共展示了ExtendedProperties.GetStringList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
/// <summary>
/// Initialize the template loader with a resources class.
/// </summary>
public override void Init(ExtendedProperties configuration)
{
object value = configuration["assembly"];
if (value is string)
{
assemblyNames = new List<string> { (string)configuration["assembly"] };
}
else if (value is List<string>)
{
assemblyNames = configuration.GetStringList("assembly");
}
else
{
throw new VelocityException("Expected property 'assembly' to be of type string or List<string>.");
}
}
示例2: Init
/// <summary>
/// Initialises the resource loader from the specified configuration.
/// </summary>
/// <param name="configuration">The configuration.</param>
public override void Init(ExtendedProperties configuration)
{
var assemblies = configuration.GetStringList("assembly");
foreach (var assembly in assemblies)
{
try
{
_assemblies.Add(Assembly.Load(assembly));
}
catch (Exception ex)
{
throw new ResourceNotFoundException(string.Format("Error when initializing NVelocity partial file resource loader: The assembly '{0}' could not be loaded.", assembly), ex);
}
}
}