本文整理汇总了C#中Config.GetLong方法的典型用法代码示例。如果您正苦于以下问题:C# Config.GetLong方法的具体用法?C# Config.GetLong怎么用?C# Config.GetLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Config
的用法示例。
在下文中一共展示了Config.GetLong方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FromConfig
/// <summary>Update properties by setting fields from the configuration.</summary>
/// <remarks>
/// Update properties by setting fields from the configuration.
/// <p/>
/// If a property is not defined in the configuration, then it is left
/// unmodified.
/// </remarks>
/// <param name="rc">configuration to read properties from.</param>
public virtual void FromConfig(Config rc)
{
SetPackedGitOpenFiles(rc.GetInt("core", null, "packedgitopenfiles", GetPackedGitOpenFiles
()));
SetPackedGitLimit(rc.GetLong("core", null, "packedgitlimit", GetPackedGitLimit())
);
SetPackedGitWindowSize(rc.GetInt("core", null, "packedgitwindowsize", GetPackedGitWindowSize
()));
SetPackedGitMMAP(rc.GetBoolean("core", null, "packedgitmmap", IsPackedGitMMAP()));
SetDeltaBaseCacheLimit(rc.GetInt("core", null, "deltabasecachelimit", GetDeltaBaseCacheLimit
()));
long maxMem = Runtime.GetRuntime().MaxMemory();
long sft = rc.GetLong("core", null, "streamfilethreshold", GetStreamFileThreshold
());
sft = Math.Min(sft, maxMem / 4);
// don't use more than 1/4 of the heap
sft = Math.Min(sft, int.MaxValue);
// cannot exceed array length
SetStreamFileThreshold((int)sft);
}
示例2: FromConfig
/// <summary>Update properties by setting fields from the configuration.</summary>
/// <remarks>
/// Update properties by setting fields from the configuration.
/// If a property's corresponding variable is not defined in the supplied
/// configuration, then it is left unmodified.
/// </remarks>
/// <param name="rc">configuration to read properties from.</param>
public virtual void FromConfig(Config rc)
{
SetMaxDeltaDepth(rc.GetInt("pack", "depth", GetMaxDeltaDepth()));
SetDeltaSearchWindowSize(rc.GetInt("pack", "window", GetDeltaSearchWindowSize()));
SetDeltaSearchMemoryLimit(rc.GetLong("pack", "windowmemory", GetDeltaSearchMemoryLimit
()));
SetDeltaCacheSize(rc.GetLong("pack", "deltacachesize", GetDeltaCacheSize()));
SetDeltaCacheLimit(rc.GetInt("pack", "deltacachelimit", GetDeltaCacheLimit()));
SetCompressionLevel(rc.GetInt("pack", "compression", rc.GetInt("core", "compression"
, GetCompressionLevel())));
SetIndexVersion(rc.GetInt("pack", "indexversion", GetIndexVersion()));
SetBigFileThreshold(rc.GetInt("core", "bigfilethreshold", GetBigFileThreshold()));
SetThreads(rc.GetInt("pack", "threads", GetThreads()));
// These variables aren't standardized
//
SetReuseDeltas(rc.GetBoolean("pack", "reusedeltas", IsReuseDeltas()));
SetReuseObjects(rc.GetBoolean("pack", "reuseobjects", IsReuseObjects()));
SetDeltaCompress(rc.GetBoolean("pack", "deltacompression", IsDeltaCompress()));
}