本文整理匯總了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();
}