本文整理汇总了C#中Config.getStringList方法的典型用法代码示例。如果您正苦于以下问题:C# Config.getStringList方法的具体用法?C# Config.getStringList怎么用?C# Config.getStringList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Config
的用法示例。
在下文中一共展示了Config.getStringList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PutGetStringList
public void PutGetStringList()
{
Config c = new Config();
List<string> values = new List<string>();
values.Add("value1");
values.Add("value2");
c.setStringList("my", null, "somename", values);
object[] expArr = values.ToArray();
string[] actArr = c.getStringList("my", null, "somename");
Assert.IsTrue(expArr.SequenceEqual(actArr));
string expText = "[my]\n\tsomename = value1\n\tsomename = value2\n";
Assert.AreEqual(expText, 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);
}