本文整理汇总了C#中Commons.Collections.ExtendedProperties.GetLong方法的典型用法代码示例。如果您正苦于以下问题:C# ExtendedProperties.GetLong方法的具体用法?C# ExtendedProperties.GetLong怎么用?C# ExtendedProperties.GetLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Commons.Collections.ExtendedProperties
的用法示例。
在下文中一共展示了ExtendedProperties.GetLong方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CommonInit
/// <summary>
/// This initialization is used by all resource
/// loaders and must be called to set up common
/// properties shared by all resource loaders
/// </summary>
public void CommonInit(IRuntimeServices rs, ExtendedProperties configuration)
{
rsvc = rs;
// these two properties are not required for all loaders.
// For example, for ClasspathLoader, what would cache mean?
// so adding default values which I think are the safest
// don't cache, and modCheckInterval irrelevant...
isCachingOn = configuration.GetBoolean("cache", false);
modificationCheckInterval = configuration.GetLong("modificationCheckInterval", 0);
// this is a must!
className = configuration.GetString("class");
}
示例2: commonInit
/// <summary> This initialization is used by all resource
/// loaders and must be called to set up common
/// properties shared by all resource loaders
/// </summary>
public virtual void commonInit(RuntimeServices rs, ExtendedProperties configuration) {
this.rsvc = rs;
/*
* these two properties are not required for all loaders.
* For example, for ClasspathLoader, what would cache mean?
* so adding default values which I think are the safest
*
* don't cache, and modCheckInterval irrelevant...
*/
isCachingOn_Renamed_Field = configuration.GetBoolean("cache", false);
modificationCheckInterval = configuration.GetLong("modificationCheckInterval", 0);
/*
* this is a must!
*/
className = configuration.GetString("class");
}
示例3: Test_run
public virtual void Test_run()
{
System.IO.StreamWriter result = null;
ExtendedProperties c = null;
try {
assureResultsDirectoryExists(RESULTS_DIR);
c = new ExtendedProperties(TEST_CONFIG);
result = new System.IO.StreamWriter(getFileName(RESULTS_DIR, "output", "res"));
} catch (System.Exception e) {
throw new System.Exception("Cannot setup CommonsExtPropTestCase!", e);
}
message(result, "Testing order of keys ...");
showIterator(result, c.Keys);
message(result, "Testing retrieval of CSV values ...");
showVector(result, c.GetVector("resource.loader"));
message(result, "Testing subset(prefix).getKeys() ...");
ExtendedProperties subset = c.Subset("file.resource.loader");
showIterator(result, subset.Keys);
message(result, "Testing getVector(prefix) ...");
showVector(result, subset.GetVector("path"));
message(result, "Testing getString(key) ...");
result.Write(c.GetString("config.string.value"));
result.Write("\n\n");
message(result, "Testing getBoolean(key) ...");
//UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Boolean.toString' may return a different value. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1043"'
result.Write(c.GetBoolean("config.boolean.value").ToString());
result.Write("\n\n");
message(result, "Testing getByte(key) ...");
result.Write(c.GetByte("config.byte.value").ToString());
result.Write("\n\n");
message(result, "Testing getShort(key) ...");
result.Write(c.GetShort("config.short.value").ToString());
result.Write("\n\n");
message(result, "Testing getInt(key) ...");
result.Write(c.GetInt("config.int.value").ToString());
result.Write("\n\n");
message(result, "Testing getLong(key) ...");
result.Write(c.GetLong("config.long.value").ToString());
result.Write("\n\n");
message(result, "Testing getFloat(key) ...");
result.Write(c.GetFloat("config.float.value").ToString());
result.Write("\n\n");
message(result, "Testing getDouble(key) ...");
result.Write(c.GetDouble("config.double.value").ToString());
result.Write("\n\n");
message(result, "Testing escaped-comma scalar...");
result.Write(c.GetString("escape.comma1"));
result.Write("\n\n");
message(result, "Testing escaped-comma vector...");
showVector(result, c.GetVector("escape.comma2"));
result.Write("\n\n");
result.Flush();
result.Close();
if (!isMatch(RESULTS_DIR, COMPARE_DIR, "output", "res", "cmp")) {
Assertion.Fail("Output incorrect.");
}
}