当前位置: 首页>>代码示例>>C#>>正文


C# Config.GetBoolean方法代码示例

本文整理汇总了C#中Config.GetBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# Config.GetBoolean方法的具体用法?C# Config.GetBoolean怎么用?C# Config.GetBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Config的用法示例。


在下文中一共展示了Config.GetBoolean方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
 }
开发者ID:sharwell,项目名称:ngit,代码行数:28,代码来源:WindowCacheConfig.cs

示例2: RemoteConfig

		/// <summary>Parse a remote block from an existing configuration file.</summary>
		/// <remarks>
		/// Parse a remote block from an existing configuration file.
		/// <p>
		/// This constructor succeeds even if the requested remote is not defined
		/// within the supplied configuration file. If that occurs then there will be
		/// no URIs and no ref specifications known to the new instance.
		/// </remarks>
		/// <param name="rc">
		/// the existing configuration to get the remote settings from.
		/// The configuration must already be loaded into memory.
		/// </param>
		/// <param name="remoteName">subsection key indicating the name of this remote.</param>
		/// <exception cref="Sharpen.URISyntaxException">one of the URIs within the remote's configuration is invalid.
		/// 	</exception>
		public RemoteConfig(Config rc, string remoteName)
		{
			name = remoteName;
			oldName = remoteName;
			string[] vlst;
			string val;
			vlst = rc.GetStringList(SECTION, name, KEY_URL);
			IDictionary<string, string> insteadOf = GetReplacements(rc, KEY_INSTEADOF);
			uris = new AList<URIish>(vlst.Length);
			foreach (string s in vlst)
			{
				uris.AddItem(new URIish(ReplaceUri(s, insteadOf)));
			}
			IDictionary<string, string> pushInsteadOf = GetReplacements(rc, KEY_PUSHINSTEADOF
				);
			vlst = rc.GetStringList(SECTION, name, KEY_PUSHURL);
			pushURIs = new AList<URIish>(vlst.Length);
			foreach (string s_1 in vlst)
			{
				pushURIs.AddItem(new URIish(ReplaceUri(s_1, pushInsteadOf)));
			}
			vlst = rc.GetStringList(SECTION, name, KEY_FETCH);
			fetch = new AList<RefSpec>(vlst.Length);
			foreach (string s_2 in vlst)
			{
				fetch.AddItem(new RefSpec(s_2));
			}
			vlst = rc.GetStringList(SECTION, name, KEY_PUSH);
			push = new AList<RefSpec>(vlst.Length);
			foreach (string s_3 in vlst)
			{
				push.AddItem(new RefSpec(s_3));
			}
			val = rc.GetString(SECTION, name, KEY_UPLOADPACK);
			if (val == null)
			{
				val = DEFAULT_UPLOAD_PACK;
			}
			uploadpack = val;
			val = rc.GetString(SECTION, name, KEY_RECEIVEPACK);
			if (val == null)
			{
				val = DEFAULT_RECEIVE_PACK;
			}
			receivepack = val;
			val = rc.GetString(SECTION, name, KEY_TAGOPT);
			tagopt = NGit.Transport.TagOpt.FromOption(val);
			mirror = rc.GetBoolean(SECTION, name, KEY_MIRROR, DEFAULT_MIRROR);
			timeout = rc.GetInt(SECTION, name, KEY_TIMEOUT, 0);
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:65,代码来源:RemoteConfig.cs

示例3: 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()));
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:26,代码来源:PackConfig.cs


注:本文中的Config.GetBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。