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


C# Config.getString方法代码示例

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


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

示例1: PutGetSimple

 public void PutGetSimple()
 {
     Config c = new Config();
     c.setString("my", null, "somename", "false");
     Assert.AreEqual("false", c.getString("my", null, "somename"));
     Assert.AreEqual("[my]\n\tsomename = false\n", c.toText());
 }
开发者ID:HackerBaloo,项目名称:GitSharp,代码行数:7,代码来源:RepositoryConfigTest.cs

示例2: RemoteConfig

        /// <summary>
        /// Parse a remote block from an existing configuration file.
        /// <para/>
        /// 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.
        /// </summary>
        /// <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>
		public RemoteConfig(Config rc, string remoteName)
		{
			if (rc == null)
				throw new ArgumentNullException ("rc");
			Name = remoteName;
			oldName = Name;

			string[] vlst = rc.getStringList(Section, Name, KeyUrl);
			URIs = new List<URIish>(vlst.Length);
			foreach (string s in vlst)
			{
				URIs.Add(new URIish(s));
			}

			vlst = rc.getStringList(Section, Name, KeyPushurl);
			PushURIs = new List<URIish>(vlst.Length);
			foreach (string s in vlst)
			{
				PushURIs.Add(new URIish(s));
			}

			vlst = rc.getStringList(Section, Name, KeyFetch);
			Fetch = new List<RefSpec>(vlst.Length);
			foreach (string s in vlst)
			{
				Fetch.Add(new RefSpec(s));
			}

			vlst = rc.getStringList(Section, Name, KeyPush);
			Push = new List<RefSpec>(vlst.Length);
			foreach (string s in vlst)
			{
				Push.Add(new RefSpec(s));
			}

			string val = rc.getString(Section, Name, KeyUploadpack) ?? DEFAULT_UPLOAD_PACK;
			UploadPack = val;

			val = rc.getString(Section, Name, KeyReceivepack) ?? DEFAULT_RECEIVE_PACK;
			ReceivePack = val;

			val = rc.getString(Section, Name, KeyTagopt);
			TagOpt = TagOpt.fromOption(val);
			Mirror = rc.getBoolean(Section, Name, KeyMirror, DefaultMirror);

			Timeout = rc.getInt(Section, Name, KeyTimeout, 0);
		}
开发者ID:dev218,项目名称:GitSharp,代码行数:59,代码来源:RemoteConfig.cs


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