本文整理汇总了C#中Config.unsetSection方法的典型用法代码示例。如果您正苦于以下问题:C# Config.unsetSection方法的具体用法?C# Config.unsetSection怎么用?C# Config.unsetSection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Config
的用法示例。
在下文中一共展示了Config.unsetSection方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Delete
/// <summary>
/// Remove this remote's definition from the configuration.
/// </summary>
/// <param name="rc">the configuration from which to remove ourselves.</param>
public void Delete (Config rc)
{
if (rc == null)
throw new ArgumentNullException ("rc");
rc.unsetSection (Section, Name);
}
示例2: Update
/// <summary>
/// Update this remote's definition within the configuration.
/// </summary>
/// <param name="rc">the configuration file to store ourselves into.</param>
public void Update(Config rc)
{
if (rc == null)
throw new ArgumentNullException ("rc");
var vlst = new List<string>();
vlst.Clear();
foreach (URIish u in URIs)
{
vlst.Add(u.ToPrivateString());
}
rc.setStringList(Section, Name, KeyUrl, vlst);
vlst.Clear();
foreach (URIish u in PushURIs)
vlst.Add(u.ToPrivateString());
rc.setStringList(Section, Name, KeyPushurl, vlst);
vlst.Clear();
foreach (RefSpec u in Fetch)
{
vlst.Add(u.ToString());
}
rc.setStringList(Section, Name, KeyFetch, vlst);
vlst.Clear();
foreach (RefSpec u in Push)
{
vlst.Add(u.ToString());
}
rc.setStringList(Section, Name, KeyPush, vlst);
Set(rc, KeyUploadpack, UploadPack, DEFAULT_UPLOAD_PACK);
Set(rc, KeyReceivepack, ReceivePack, DEFAULT_RECEIVE_PACK);
Set(rc, KeyTagopt, TagOpt.Option, TagOpt.AUTO_FOLLOW.Option);
Set(rc, KeyMirror, Mirror, DefaultMirror);
Set(rc, KeyTimeout, Timeout, 0);
if (oldName != Name) {
rc.unsetSection (Section, oldName);
oldName = Name;
}
}