本文整理汇总了C#中Branch.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Branch.ToString方法的具体用法?C# Branch.ToString怎么用?C# Branch.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Branch
的用法示例。
在下文中一共展示了Branch.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Heads
public static HgArguments Heads(Branch branch)
{
if (branch == null)
{
throw new ArgumentNullException("branch");
}
return new HgArguments().Add("heads").Add(branch.ToString());
}
示例2: ChangeBranch
public static HgArguments ChangeBranch(Branch branch)
{
if (branch == null)
{
throw new ArgumentNullException("branch");
}
if (branch == Branch.NotSpecified)
{
throw new ArgumentOutOfRangeException("branch", branch, "Branch must be specified.");
}
return new HgArguments().Add("branch").Add(branch.ToString());
}
示例3: OnlyBranch
public HgArguments OnlyBranch(Branch branch)
{
if (branch == null)
{
throw new ArgumentNullException("branch");
}
return branch != Branch.NotSpecified ? Add("--only-branch", branch.ToString()) : this;
}
示例4: SwitchBranchOLD
public string SwitchBranchOLD(IrcCommand command)
{
string name = command.Parameters[0];
Branch b;
bool success = Enum.TryParse(name, out b);
//Either branch does not exist, or we've selected a private branch in a public channel
if (!success || (!Constants.PublicBranch[b] && command.Destination != "#reside_priv"))
{
Branch[] branches = null;
if (command.Destination == "#reside_priv")
{
branches = AllBranches.ToArray();
}
else
{
branches = AllBranches.Where(x => Constants.PublicBranch[x]).ToArray();
}
string bString = "{ ";
foreach (Branch branch in branches)
{
bString += branch.ToString() + ", ";
}
bString = bString.Remove(bString.Length - 2) + " }";
return "Branch not found: " + name + ". Possible Branches: " + bString;
}
if (b == CurrentBranchOLD) return "Already on branch: " + CurrentBranchOLD.ToString();
CurrentBranchOLD = b;
return "Switched to " + CurrentBranchOLD.ToString();
}