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


C# Config.GetSubsections方法代码示例

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


在下文中一共展示了Config.GetSubsections方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetReplacements

		private IDictionary<string, string> GetReplacements(Config config, string keyName
			)
		{
			IDictionary<string, string> replacements = new Dictionary<string, string>();
			foreach (string url in config.GetSubsections(KEY_URL))
			{
				foreach (string insteadOf in config.GetStringList(KEY_URL, url, keyName))
				{
					replacements.Put(insteadOf, url);
				}
			}
			return replacements;
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:13,代码来源:RemoteConfig.cs

示例2: GetAllRemoteConfigs

		/// <summary>
		/// Parse all remote blocks in an existing configuration file, looking for
		/// remotes configuration.
		/// </summary>
		/// <remarks>
		/// Parse all remote blocks in an existing configuration file, looking for
		/// remotes configuration.
		/// </remarks>
		/// <param name="rc">
		/// the existing configuration to get the remote settings from.
		/// The configuration must already be loaded into memory.
		/// </param>
		/// <returns>
		/// all remotes configurations existing in provided repository
		/// configuration. Returned configurations are ordered
		/// lexicographically by names.
		/// </returns>
		/// <exception cref="Sharpen.URISyntaxException">one of the URIs within the remote's configuration is invalid.
		/// 	</exception>
		public static IList<NGit.Transport.RemoteConfig> GetAllRemoteConfigs(Config rc)
		{
			IList<string> names = new AList<string>(rc.GetSubsections(SECTION));
			names.Sort();
			IList<NGit.Transport.RemoteConfig> result = new AList<NGit.Transport.RemoteConfig
				>(names.Count);
			foreach (string name in names)
			{
				result.AddItem(new NGit.Transport.RemoteConfig(rc, name));
			}
			return result;
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:31,代码来源:RemoteConfig.cs


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