本文整理汇总了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());
}
示例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);
}